Commit 323724d5 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Add an option to silence snmpit when building vlans; used from the

protogeni code to cut down on the logging mail.
parent b00291bc
...@@ -2179,12 +2179,14 @@ sub ExperimentVLans($$$) ...@@ -2179,12 +2179,14 @@ sub ExperimentVLans($$$)
# #
# Utility function to add a vlan to the switch infrastructure. # Utility function to add a vlan to the switch infrastructure.
# #
sub Instantiate($) sub Instantiate($;$)
{ {
my ($self) = @_; my ($self, $quiet) = @_;
return -1 return -1
if (! ref($self)); if (! ref($self));
$quiet = 0
if (!defined($quiet));
my $experiment = $self->GetExperiment(); my $experiment = $self->GetExperiment();
return -1 return -1
...@@ -2194,9 +2196,10 @@ sub Instantiate($) ...@@ -2194,9 +2196,10 @@ sub Instantiate($)
my $eid = $experiment->eid(); my $eid = $experiment->eid();
my $vname = $self->vname(); my $vname = $self->vname();
my $lanid = $self->lanid(); my $lanid = $self->lanid();
my $opt = ($quiet ? "-q" : "");
#print "Setting up VLAN $vname ($lanid) in $pid/$eid\n"; #print "Setting up VLAN $vname ($lanid) in $pid/$eid\n";
system("$SNMPIT -t $pid $eid $lanid"); system("$SNMPIT $opt -t $pid $eid $lanid");
return -1 return -1
if ($?); if ($?);
return 0; return 0;
...@@ -2205,12 +2208,14 @@ sub Instantiate($) ...@@ -2205,12 +2208,14 @@ sub Instantiate($)
# #
# Utility function to remove a vlan from the switch infrastructure. # Utility function to remove a vlan from the switch infrastructure.
# #
sub UnInstantiate($) sub UnInstantiate($;$)
{ {
my ($self) = @_; my ($self, $quiet) = @_;
return -1 return -1
if (! ref($self)); if (! ref($self));
$quiet = 0
if (!defined($quiet));
my $experiment = $self->GetExperiment(); my $experiment = $self->GetExperiment();
return -1 return -1
...@@ -2220,9 +2225,10 @@ sub UnInstantiate($) ...@@ -2220,9 +2225,10 @@ sub UnInstantiate($)
my $eid = $experiment->eid(); my $eid = $experiment->eid();
my $vname = $self->vname(); my $vname = $self->vname();
my $lanid = $self->lanid(); my $lanid = $self->lanid();
my $opt = ($quiet ? "-q" : "");
#print "Removing VLAN $vname ($lanid) from $pid/$eid\n"; #print "Removing VLAN $vname ($lanid) from $pid/$eid\n";
system("$SNMPIT -r $pid $eid $lanid"); system("$SNMPIT $opt -r $pid $eid $lanid");
return -1 return -1
if ($?); if ($?);
return 0; return 0;
......
Markdown is supported
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