Commit 8689a1e5 authored by Mike Hibler's avatar Mike Hibler

Merge branch 'master' of gitlab.flux.utah.edu:emulab/emulab-devel

parents 7257198b c14472f9
......@@ -5044,6 +5044,8 @@ sub SliverWorkAux($)
#
$inaggregate = 1;
$sliver = $nodemap{$virtual_id};
# Replace the existing rspec/manifest
$sliver->UpdateRspec($ref);
}
else {
$sliver = GeniSliver::Node->Create($slice, $owner, $node, $ref);
......@@ -5686,7 +5688,8 @@ sub SliverWorkAux($)
goto bad;
}
my $siteinfo = GeniXML::FindFirst("n:site_info", $manifest);
my $siteinfo = GeniXML::FindFirstNS("n:site_info", $manifest,
$GeniXML::SITEINFO_NS);
if (defined($siteinfo)) {
# Clean old location.
$manifest->removeChild($siteinfo);
......@@ -5726,11 +5729,9 @@ sub SliverWorkAux($)
print STDERR "GeniUsage->NewAggregate($aggregate) failed\n";
}
# This should move someplace else?
$aggregate->UpdateManifest($manifest);
# Need this below.
my $manifest_string = GeniXML::Serialize($manifest);
DBQueryWarn("replace into geni_manifests set ".
" manifest=". DBQuoteSpecial($manifest_string) . ", " .
" idx=NULL, slice_uuid='$slice_uuid', created=now()");
#
# Cache the credential for subsequent requests. See GetSliver().
......
......@@ -2398,9 +2398,10 @@ sub DeleteNodes($)
#
# Suck out nodes. Also figure out what nodes have to be removed
# from which lans.
# from which lans, and which ifaces from which nodes.
#
my %ifacestoremovefromlans = ();
my %ifacestoremovefromlans = ();
my %ifacestoremovefromnodes = ();
foreach my $noderef (GeniXML::FindNodes("n:node",
$manifest)->get_nodelist()) {
......@@ -2438,9 +2439,29 @@ sub DeleteNodes($)
my @ifaces = GeniXML::FindNodes("n:interface_ref",
$linkref)->get_nodelist();
if (@ifaces <= 1) {
# Need to find this last iface in the node and delete it
# since otherwise the rspec would be malformed.
foreach my $iref (@ifaces) {
my $client_id = GeniXML::GetInterfaceId($iref);
$ifacestoremovefromnodes{$client_id} = $client_id;
}
$manifest->removeChild($linkref);
}
}
# Purge the ifaces from nodes for links left with just one iface.
if (keys(%ifacestoremovefromnodes)) {
foreach my $noderef (GeniXML::FindNodes("n:node",
$manifest)->get_nodelist()) {
foreach my $iref (GeniXML::FindNodes("n:interface",
$noderef)->get_nodelist()) {
my $client_id = GeniXML::GetInterfaceId($iref);
if (exists($ifacestoremovefromnodes{$client_id})) {
$noderef->removeChild($iref);
}
}
}
}
my $rspecstr = GeniXML::Serialize($manifest);
print STDERR "$rspecstr\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