Commit 59b243a2 authored by Gary Wong's avatar Gary Wong

Automatically configure RF links on sliver creation/deletion.

parent 5e5cb550
......@@ -124,6 +124,7 @@ my $TARINSTALL = "/usr/local/bin/install-tarfile";
my $IMAGE_SETUP = "$TB/sbin/image_setup";
my $IMAGE_IMPORT = "$TB/sbin/image_import";
my $SHAREVLAN = "$TB/sbin/sharevlan";
my $RFLINKS = "$TB/bin/rflinks";
my $FWNAME = "fw";
my $API_VERSION = 1;
my $PROTOGENI_LOCALUSER = @PROTOGENI_LOCALUSER@;
......@@ -4546,7 +4547,13 @@ sub SliverWorkAux($$$$$$$$)
}
GeniXML::SetText("vlantag", $linkref, $tag);
}
if( !$isupdate ) {
if( system( "$RFLINKS $pid $eid" ) ) {
print STDERR "Failed to add RF links!\n";
}
}
# Set up plab nodes all at once.
if ($needplabslice && @plabnodes && !$impotent) {
my @node_ids = map { $_->node_id() } @plabnodes;
......@@ -4730,6 +4737,11 @@ sub SliverWorkAux($$$$$$$$)
print STDERR "Could not tear down vlans\n";
}
system( "$RFLINKS -r $pid $eid" );
if( $? ) {
print STDERR "Failed to remove RF links\n";
}
# Remove any residual state.
if ($experiment->RemovePhysicalState(1)) {
print STDERR "Could not remove physical state!\n";
......@@ -5086,6 +5098,11 @@ sub DeleteSliverAux($$$)
my $eid = $experiment->eid();
if (!$impotent) {
system("$RFLINKS -r $pid $eid");
if ($?) {
print STDERR "Could not tear down RF links!\n";
}
system("$SNMPIT -C -r $pid $eid");
if ($?) {
print STDERR "Could not tear down vlans\n";
......
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