TT#131253 show_flow.pl: remove kamailio yaml flow info options

Change-Id: Idab01a97727da636be33bab29ce5d020ffaf667d
mr10.1.1
Victor Seva 5 years ago
parent c5b1b1ca99
commit 981fa37bfc

@ -25,6 +25,8 @@ use Cwd 'abs_path';
use Data::Dumper; use Data::Dumper;
use Getopt::Long; use Getopt::Long;
use English; use English;
use utf8;
use JSON;
sub usage sub usage
{ {
@ -32,14 +34,13 @@ sub usage
$output .= "\tOptions:\n"; $output .= "\tOptions:\n";
$output .= "-h --help: this help\n"; $output .= "-h --help: this help\n";
$output .= "-y --yml: yaml output\n"; $output .= "-y --yml: yaml output\n";
$output .= "-j --json: json input\n";
return $output return $output
} }
my $yml = ''; my $yml = '';
my $help = 0; my $help = 0;
my $json_in = 0; my $json_in = 0;
GetOptions ("y|yml" => \$yml, "h|help" => \$help, "j|json" => \$json_in) GetOptions ("y|yml" => \$yml, "h|help" => \$help)
or die("Error in command line arguments\n".usage()); or die("Error in command line arguments\n".usage());
if($#ARGV!=0 || $help) if($#ARGV!=0 || $help)
@ -48,9 +49,6 @@ if($#ARGV!=0 || $help)
} }
my $filename = abs_path($ARGV[0]); my $filename = abs_path($ARGV[0]);
my $inlog; my $inlog;
if($json_in) {
use utf8;
use JSON;
my $json; my $json;
{ {
local $INPUT_RECORD_SEPARATOR = undef; #Enable 'slurp' mode local $INPUT_RECORD_SEPARATOR = undef; #Enable 'slurp' mode
@ -59,11 +57,6 @@ if($json_in) {
close $fh; close $fh;
} }
$inlog = decode_json($json); $inlog = decode_json($json);
}
else {
use YAML::XS;
$inlog = YAML::XS::LoadFile($filename);
}
foreach my $i (@{$inlog->{'flow'}}) foreach my $i (@{$inlog->{'flow'}})
{ {

Loading…
Cancel
Save