Commit 4b8a9915 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

More changes to cooked mode for PLC. Better URN handling.

parent a60fa581
......@@ -200,7 +200,7 @@ sub MapResources($$$$$)
# If so, must convert it to something assign can grok.
#
if ($resource->IsSFA()) {
$advertisement = ConvertAdSFAtoPG($advertisement,
$advertisement = ConvertSFAtoPG($advertisement, "ad",
$resource->manager_urn());
return -1
if (!defined($advertisement));
......@@ -573,7 +573,7 @@ sub MapResourcesNew($$$$$)
# If so, must convert it to something assign can grok.
#
if ($resource->IsSFA()) {
$advertisement = ConvertAdSFAtoPG($advertisement,
$advertisement = ConvertSFAtoPG($advertisement, "ad",
$resource->manager_urn());
return -1
if (!defined($advertisement));
......@@ -1059,6 +1059,24 @@ sub GetTickets($)
#
$object = $resource->Manifest();
#
# Convert SFA manifest to rspec format.
#
if ($object && $resource->IsSFA()) {
my $tmp = ConvertSFAtoPG($object, "manifest",
$resource->manager_urn());
if (!defined($tmp) ||
$resource->UpdateManifest($tmp)) {
print STDERR "Could not store manifest for $resource\n";
$errors++;
$object = undef;
}
else {
# reload.
$object = $tmp;
}
}
# File the rspec away since that is what we have.
if ($resource->UpdateRspec($resource->stashedrspec())) {
print STDERR "Could not store rspec for $resource\n";
......@@ -2378,9 +2396,9 @@ sub AddLinkToRspec($$)
return $rspeclink;
}
sub ConvertAdSFAtoPG($$)
sub ConvertSFAtoPG($$$)
{
my ($rspec, $manager_urn) = @_;
my ($rspec, $type, $manager_urn) = @_;
# Parse if a string.
if (! ref($rspec)) {
......@@ -2426,6 +2444,8 @@ sub ConvertAdSFAtoPG($$)
$rspecnode->setAttribute('component_uuid', $urn);
$rspecnode->setAttribute('component_urn', $urn);
$rspecnode->setAttribute('component_name', "$id:$name");
if ($type eq "ad") {
my $tmp = addChildToRspec($doc, $rspecnode, 'node_type');
$tmp->setAttribute("type_name", "pc");
$tmp->setAttribute("type_slots", "1");
......@@ -2437,6 +2457,7 @@ sub ConvertAdSFAtoPG($$)
}
}
}
}
return $root;
}
......
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