Commit 9a23a669 authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

Minor debugging additions.

parent c7390433
...@@ -476,6 +476,7 @@ sub SetupVlans($) ...@@ -476,6 +476,7 @@ sub SetupVlans($)
} }
# Not doing stacks yet. # Not doing stacks yet.
my $stackopt = ""; my $stackopt = "";
my $debugopt = ($debug ? "-v" : "");
# Now call snmpit to create the actual vlans. # Now call snmpit to create the actual vlans.
if ($debug) { if ($debug) {
...@@ -484,7 +485,7 @@ sub SetupVlans($) ...@@ -484,7 +485,7 @@ sub SetupVlans($)
return $errors return $errors
if ($impotent); if ($impotent);
system("$TB/bin/snmpit $stackopt -t $pid $eid @outer_ids"); system("$TB/bin/snmpit $debugopt $stackopt -t $pid $eid @outer_ids");
if ($?) { if ($?) {
# #
# Yuck failed. We leave things as is, and wait for experiment # Yuck failed. We leave things as is, and wait for experiment
...@@ -609,11 +610,12 @@ sub DestroyVlans($) ...@@ -609,11 +610,12 @@ sub DestroyVlans($)
my $stack = $vlan->GetStack(); my $stack = $vlan->GetStack();
# Not doing stacks yet; # Not doing stacks yet;
my $stackopt = ""; my $stackopt = "";
my $debugopt = ($debug ? "-v" : "");
if ($debug) { if ($debug) {
print STDERR "Running 'snmpit $stackopt -r $pid $eid $outer_id'\n"; print STDERR "Running 'snmpit $stackopt -r $pid $eid $outer_id'\n";
} }
system("$TB/bin/snmpit $stackopt -r $pid $eid $outer_id"); system("$TB/bin/snmpit $debugopt $stackopt -r $pid $eid $outer_id");
if ($?) { if ($?) {
# #
# Yuck failed. We leave things as is, and wait for the # Yuck failed. We leave things as is, and wait for the
...@@ -723,6 +725,7 @@ sub Trunk($) ...@@ -723,6 +725,7 @@ sub Trunk($)
fatal("Trunk: Improper stack argument: $stack"); fatal("Trunk: Improper stack argument: $stack");
} }
} }
my $debugopt = ($debug ? "-v" : "");
$port =~ /^(.+):(.+)/; $port =~ /^(.+):(.+)/;
my ($node, $card) = ($1,$2); my ($node, $card) = ($1,$2);
...@@ -758,7 +761,7 @@ sub Trunk($) ...@@ -758,7 +761,7 @@ sub Trunk($)
if ($debug) { if ($debug) {
print STDERR "Running 'snmpit $stackopt -U $port'\n"; print STDERR "Running 'snmpit $stackopt -U $port'\n";
} }
system("$TB/bin/snmpit $stackopt -U $port"); system("$TB/bin/snmpit $debugopt $stackopt -U $port");
if ($?) { if ($?) {
# Yuck failed. # Yuck failed.
fatal("snmpit $stackopt -U failed!"); fatal("snmpit $stackopt -U failed!");
...@@ -802,7 +805,7 @@ sub Trunk($) ...@@ -802,7 +805,7 @@ sub Trunk($)
# Okay, ask snmpit to trunk these vlans. # Okay, ask snmpit to trunk these vlans.
# #
my $command = my $command =
"$TB/bin/snmpit $stackopt $mode $port @outer_ids"; "$TB/bin/snmpit $debugopt $stackopt $mode $port @outer_ids";
if ($debug) { print STDERR "Running $command\n"; } if ($debug) { print STDERR "Running $command\n"; }
system($command); system($command);
if ($?) { if ($?) {
...@@ -829,7 +832,8 @@ sub PortControl($) ...@@ -829,7 +832,8 @@ sub PortControl($)
my @ports = @{ $args->{'ports'} }; my @ports = @{ $args->{'ports'} };
# Not doing stacks yet; # Not doing stacks yet;
my $stack = "Experimental"; my $stack = "Experimental";
my $debugopt = ($debug ? "-v" : "");
# #
# Check the ports. Must be valid format and belong to node reserved # Check the ports. Must be valid format and belong to node reserved
...@@ -899,7 +903,7 @@ sub PortControl($) ...@@ -899,7 +903,7 @@ sub PortControl($)
if ($debug) { if ($debug) {
print STDERR "Running 'snmpit $command @ports\n"; print STDERR "Running 'snmpit $command @ports\n";
} }
system("$TB/bin/snmpit $command @ports"); system("$TB/bin/snmpit $debugopt $command @ports");
if ($?) { if ($?) {
# Yuck failed. # Yuck failed.
fatal("snmpit $command @ports"); fatal("snmpit $command @ports");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment