Commit 8848b2ad authored by Leigh B Stoller's avatar Leigh B Stoller

Minor bug fix to avoid turning component_urn into a list

parent fe51a12e
......@@ -926,6 +926,7 @@ sub GetTicketAuxAux($$$$$$$$)
my @interfaces = GeniXML::FindNodes("n:linkendpoints | ".
"n:interface_ref",
$linkref)->get_nodelist();
my %managers = undef;
my $ifacenum = 1;
my $trivial_ok = 0;
......@@ -935,6 +936,23 @@ sub GetTicketAuxAux($$$$$$$$)
goto bad;
}
#
# Look for managers list; optional for now. If not specified then
# we assume the link is for thie CM.
#
if (GeniXML::FindNodes("n:component_manager", $linkref)) {
%managers = map { GeniXML::GetText("id", $_) => $_ }
GeniXML::FindNodes("n:component_manager",
$linkref)->get_nodelist();
#
# Initial check for the entire link. We check on a per interface
# case below.
#
next
if (!exists($managers{$ENV{'MYURN'}}));
}
#
# Ick. Before we create the virt_lan_lans entry, we have to check
# inside to see if one of the interfaces is connected to a lan
......@@ -1931,6 +1949,7 @@ sub SliverWorkAux($$$$$$$)
# For the manifest.
GeniXML::SetText("sliver_urn", $ref, $sliver->sliver_urn());
GeniXML::SetText("component_urn", $ref, $sliver->component_urn());
# Add to the aggregate.
if ($sliver->SetAggregate($aggregate) != 0) {
......@@ -1960,6 +1979,7 @@ sub SliverWorkAux($$$$$$$)
foreach my $linkref (GeniXML::FindNodes("n:link",
$rspec)->get_nodelist()) {
my @linkslivers = ();
my %managers = undef;
my $linkname = GeniXML::GetVirtualId($linkref);
my @interfaces = GeniXML::FindNodes("n:linkendpoints | ".
"n:interface_ref",
......@@ -1970,6 +1990,23 @@ sub SliverWorkAux($$$$$$$)
goto bad;
}
#
# Look for managers list; optional for now. If not specified then
# we assume the link is for thie CM.
#
if (GeniXML::FindNodes("n:component_manager", $linkref)) {
%managers = map { GeniXML::GetText("id", $_) => $_ }
GeniXML::FindNodes("n:component_manager",
$linkref)->get_nodelist();
#
# Initial check for the entire link. We check on a per interface
# case below.
#
next
if (!exists($managers{$ENV{'MYURN'}}));
}
# Do not worry about modifying a link that is setup. Later.
next
if (grep {$_ eq $linkname} keys(%linkmap));
......@@ -3917,6 +3954,7 @@ sub CleanupDeadSlice($;$)
return -1
if ($?);
$experiment->Flush();
$slice->SetExperiment(undef);
}
if ($slice->Delete() != 0) {
......@@ -3973,6 +4011,7 @@ sub GeniExperiment($)
$experiment = Experiment->Lookup($uuid);
$experiment->SetState(EXPTSTATE_SWAPPED());
$experiment->Update({"geniflags" => $Experiment::EXPT_GENIFLAGS_EXPT});
$slice->SetExperiment($experiment);
}
return $experiment;
}
......
#!/usr/bin/perl -wT
#
# GENIPUBLIC-COPYRIGHT
# Copyright (c) 2008-2009 University of Utah and the Flux Group.
# Copyright (c) 2008-2010 University of Utah and the Flux Group.
# All rights reserved.
#
package GeniSliver;
......@@ -558,7 +558,7 @@ use XML::Simple;
use libdb qw(TBDB_ALLOCSTATE_RES_INIT_DIRTY TBDB_NODESTATE_SHUTDOWN
TBResolveNextOSID TBDB_NODESTATE_ISUP TBDB_NODESTATE_TBFAILED);
# Return the URN.
# Error log for local physical node.
sub ErrorLog($)
{
my ($self) = @_;
......@@ -661,7 +661,6 @@ sub Create($$$$$$)
$resource_id = $node->node_id();
$hostname = $node->node_id() . ".${OURDOMAIN}";
}
my $component_urn = GeniHRN::Generate($OURDOMAIN, "node", $resource_id);
#
# Add this stuff to the rspec (which becomes the manifest).
......@@ -669,7 +668,6 @@ sub Create($$$$$$)
$rspec->setAttribute("sliver_uuid", $sliver_uuid);
$rspec->setAttribute("hostname", $hostname);
$rspec->setAttribute("sshdport", $sshdport) if (defined($sshdport));
$rspec->setAttribute("component_urn", $component_urn);
return GeniSliver->Create($slice, $user, $sliver_uuid, $resource_uuid,
"Node", $resource_id, $hrn, $nickname, $rspec);
......
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