Commit 96518d62 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

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

parents beff6c7c e5cecc22
......@@ -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);
}
......
......@@ -133,7 +133,16 @@ sub hrn($)
return $1
if ($1 ne "");
}
# GENI AM compatibility with PlanetLab
# Use the URN from the Subject Alt Name to create the HRN
my ($authority, $type, $name) = GeniHRN::Parse($self->urn());
# Match authority up to the first colon, then add "." and name.
if ($authority =~ /^([^:]+):/) {
my $hrn = $1 . "." . $name;
return $hrn;
}
print STDERR "Cannot find hrn inside DN: '" . $self->DN() . "'\n";
print STDERR "Cannot find hrn inside urn: '" . $self->urn() . "'\n";
return "unknown";
}
sub email($)
......@@ -372,6 +381,12 @@ sub LoadFromFile($$)
return undef;
}
# GENI AM: CN might not be a UUID, so check it.
# If it is not a UUID, make one up.
if ($uuid !~ /^\w+\-\w+\-\w+\-\w+\-\w+$/) {
$uuid = GeniUtil::NewUUID();
}
my $self = {};
$self->{'CERT'} = {};
$self->{'stored'} = 0;
......
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