Commit 3787dd35 authored by Leigh B Stoller's avatar Leigh B Stoller

Add client_id to CM SliverStatus blob, for each sliver. Mapped to

geni_client_id in the AM SliverStatus and Describe methods. Requested by
Aaron.

Also a fix to Credential2SliceAggregate.
parent a60cc3f7
......@@ -513,6 +513,7 @@ sub SliverStatus()
while ( my ($pgurn, $pgrstat) = each(%$details) ) {
my $child = {
'geni_urn' => $pgurn,
'geni_client_id' => $pgrstat->{'client_id'},
# XXX Need to massage status to one of the AM status values
'geni_status' => $pgrstat->{'status'},
'geni_error' => $pgrstat->{'error'},
......@@ -735,6 +736,7 @@ sub Describe
foreach my $sliver (@slivers) {
$sliver_blob = {
'geni_sliver_urn' => $sliver->sliver_urn(),
'geni_client_id' => $sliver->nickname(),
'geni_expires' => $slice->ExpirationUTC(),
'geni_allocation_status' => "geni_provisioned",
'geni_operational_status' => GetOpState($sliver),
......
......@@ -1156,6 +1156,7 @@ sub SliverStatus($)
my $resource_id = $sliver->resource_id();
my $state = $sliver->state();
my $status = $sliver->status();
my $nickname = $sliver->nickname() || "";
my $error = "";
# New is the same as stopped. Separate state is handy.
......@@ -1167,6 +1168,7 @@ sub SliverStatus($)
}
$blob->{'details'}->{$sliver_urn} = {
"component_urn" => $resource_id,
"client_id" => $nickname,
"state" => $state,
"status" => $status,
"error" => $error,
......@@ -2257,7 +2259,8 @@ sub Credential2SliceAggregate($)
}
}
}
my (undef, $certtype, undef) = GeniHRN::Parse($target_cert->urn());
#
# Make sure the certificate has not changed. If it has, we have to
# check the UUID, since we need to support regen of the
......@@ -2265,7 +2268,8 @@ sub Credential2SliceAggregate($)
# a straight comparison will fail. So look to see if the UUID is
# the same. If so, we store the new certificate.
#
if (defined($slice) && !$target_cert->SameCert($slice)) {
if (defined($slice) && $certtype eq "slice" &&
!$target_cert->SameCert($slice)) {
if ($target_cert->uuid() eq $slice->uuid()) {
print STDERR "Updating certificate for $slice to $target_cert\n";
$slice->GetCertificate()->Delete();
......
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