Commit 417e3e68 authored by Leigh Stoller's avatar Leigh Stoller

Couple more manifest update fixes.

parent d88b614e
......@@ -1816,6 +1816,9 @@ sub GetTicketAuxAux($$$$$$$$$$)
#
if (GeniXML::HasTagSetting($linkref)) {
$encap = (IsTaggedLan($linkref) ? "vlan" : "default");
if (IsTaggedLan($linkref)) {
$trivial_ok = 0;
}
}
#
......@@ -3892,18 +3895,6 @@ sub SliverWorkAux($$$$$$$$)
$sliver->sliver_urn());
GeniXML::SetText($macName, $outref, $macAddress)
if (defined($macAddress));
#
# All this stuff above should move into GeniSliver, since
# now that we changed the node manifest, we have to store
# it back into the DB so that we do not lose it later.
#
if (!GeniXML::IsVersion0($ifaceref) && defined($nodesliver) &&
$nodesliver->UpdateRspec($outref)) {
$message = "Could not store annotated manifest for ".
"node $nodesliver\n";
goto bad;
}
}
if (!$inaggregate &&
......@@ -3918,6 +3909,23 @@ sub SliverWorkAux($$$$$$$$)
GeniXML::ReplaceNode($oldlink, $linkref);
}
#
# We have to go back through the nodes and store the manifest again,
# since we might have changed the interfaces down inside the node in
# the loop above.
#
foreach my $ref (GeniXML::FindNodes("n:node",
$manifest)->get_nodelist()) {
my $node_id = GeniXML::GetVirtualId($ref);
if (exists($nodemap{$node_id})) {
my $nodesliver = $nodemap{$node_id};
if ($nodesliver->UpdateRspec($ref)) {
print STDERR "Could not store manifest for $nodesliver\n";
}
}
}
skiplinks:
#
# Create a planetlab slice before provisioning (which creates nodes).
......
......@@ -1755,7 +1755,7 @@ sub BindToSlice($)
my $manifest = $aggregate->GetManifest(0);
foreach my $ref (GeniXML::FindNodes("n:node",
$manifest)->get_nodelist()) {
my $virt_id = GeniXML::GetVirtualId($ref);
my $sliver_id = GeniXML::GetSliverId($ref);
next
if (!defined($sliver_id));
......@@ -1766,7 +1766,8 @@ sub BindToSlice($)
my $node_manifest = $sliver->AnnotateManifest();
if (defined($node_manifest)) {
# And store into the new manifest.
GeniXML::ReplaceNode($ref, $node_manifest);
my $oldnode = GeniXML::GetNodeByVirtualId($virt_id, $manifest);
GeniXML::ReplaceNode($oldnode, $node_manifest);
}
}
$aggregate->UpdateManifest($manifest);
......
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