Commit 5799b8f1 authored by Leigh Stoller's avatar Leigh Stoller

BUG FIX: fix two instances where vlans were being left behind

(orphaned) by the protogeni code.
parent bb0d9e3e
......@@ -980,21 +980,19 @@ sub Start($$$)
print STDERR "$NAMEDSETUP failed\n";
return -1;
}
if ($restart) {
my @diff = ();
my @same = ();
my @diff = ();
my @same = ();
if (Lan->CompareVlansWithSwitches($experiment, \@diff, \@same)) {
print STDERR "CompareVlansWithSwitches failed!\n";
if (Lan->CompareVlansWithSwitches($experiment, \@diff, \@same)) {
print STDERR "CompareVlansWithSwitches failed!\n";
return -1;
}
if (@diff) {
system("$SNMPIT -f ". join(" ", map("-o $_", @diff)));
if ($?) {
print STDERR "Failed to remove obsolete VLANs.\n";
return -1;
}
if (@diff) {
system("$SNMPIT -f ". join(" ", map("-o $_", @diff)));
if ($?) {
print STDERR "Failed to remove obsolete VLANs.\n";
return -1;
}
}
}
system("$SNMPIT -q -t $pid $eid");
if ($?) {
......
......@@ -4032,6 +4032,7 @@ sub CleanupDeadSlice($;$)
{
my ($slice, $purge) = @_;
require Firewall;
require Lan;
# Default to full purge.
$purge = 1
......@@ -4051,6 +4052,23 @@ sub CleanupDeadSlice($;$)
return -1;
}
#
# Remove any stale vlans.
#
my @stale;
if (VLan->StaleVlanList($experiment, \@stale) != 0) {
print STDERR "Failed to get stale VLANs\n";
return -1;
}
if (@stale) {
print STDERR "Removing stale vlans @stale\n";
system("$SNMPIT -f ". join(" ", map("-o $_", @stale)));
if ($?) {
print STDERR "Failed to remove stale VLANs\n";
return -1;
}
}
#
# A firewalled slice gets special treatment.
#
......
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