Commit 8fbe1ab3 authored by David Johnson's avatar David Johnson

Bug fixes and per-experiment VLAN removal.

Now that we have logical wires, we *must* actually make sure that the
VLANs created on the per-experiment switch are removed at swapout (i.e.,
are at least removed from the vlans table), so that any logical wires can
be safely removed.  For now, we actually invoke snmpit to remove them.
This is probably a bad idea, because who knows what state the user left
the switch in prior to swapout.

The bugfixes are just me forgetting that \ does not continue a line in
perl :).
parent 77dbad39
......@@ -528,13 +528,34 @@ sub doSwapout($) {
# Grab our per-experiment switch stack name.
#
my @expswitches = $experiment->SwitchList(1);
my ($perexpstack,$leader,@curswitches) = \
my ($perexpstack,$leader,@curswitches) =
GetPerExperimentSwitchStack($experiment);
my $stackarg = "";
if (defined($perexpstack) && (@expswitches || @curswitches)) {
$stackarg = "-S $perexpstack --skip-supplied";
}
#
# Remove per-experiment switch stacks.
#
# Clean up any reserved VLAN tags in per-experiment switches so that
# underlying logical wires can be deleted!
#
if ($type != MODIFY && defined($perexpstack)) {
# Kill tag reservations on actual swapout.
TBDebugTimeStamp("snmpit started");
print STDERR "Removing per-experiment VLANs.\n";
if (system("snmpit -S $perexpstack --redirect-err -r $pid $eid")) {
tbwarn "Failed to remove per-experiment VLANs";
}
TBDebugTimeStamp("snmpit finished");
}
if ($type >= RETRY && defined($perexpstack)) {
print STDERR "Removing per-experiment switch stack.\n";
DeletePerExperimentSwitchStack($experiment);
$stackarg = "";
}
#
# Clean up any VLANs in experiment.
#
......@@ -579,15 +600,6 @@ sub doSwapout($) {
}
}
}
#
# Remove per-experiment switch stacks -- don't bother to check if there
# are any; it's cheap.
#
if ($type >= RETRY && defined($perexpstack)) {
print STDERR "Removing per-experiment switch stack.\n";
DeletePerExperimentSwitchStack($experiment);
}
}
if ($type >= MODIFY) {
......@@ -981,7 +993,7 @@ sub doSwapin($) {
# Still haven't done any vlan synch for modify.
#
my @expswitches = $experiment->SwitchList(1);
my ($perexpstack,$leader,@curswitches) = \
my ($perexpstack,$leader,@curswitches) =
GetPerExperimentSwitchStack($experiment);
my $stackarg = "";
if (($type > MODIFY && @expswitches)
......
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