Commit 9d4fc9fd authored by Tom Mitchell's avatar Tom Mitchell
Browse files

Add urn lookup to Credential2SliceAggregate.

Non-ProtoGENI certs/creds do not contain a UUID, so slices must be
resolved by URN. Added a URN lookup and if that fails, fall back to UUID.
parent c1ad1734
......@@ -1465,10 +1465,19 @@ sub LookupURN($)
sub Credential2SliceAggregate($)
{
my ($credential) = @_;
my $target_urn = $credential->target_urn();
my $target_uuid = $credential->target_uuid();
my $slice;
my $aggregate;
my $slice = GeniSlice->Lookup($target_uuid);
print STDERR "Credential2SliceAggregate target_urn = $target_urn\n";
# First try the target urn, then fall back to the uuid
$slice = GeniSlice->Lookup($target_urn);
if (! defined($slice)) {
# Could not find it by urn, trying uuid
print STDERR "Credential2SliceAggregate target_uuid = $target_uuid\n";
$slice = GeniSlice->Lookup($target_uuid);
}
if (defined($slice)) {
$aggregate = GeniAggregate->SliceAggregate($slice);
}
......
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