Commit a69902f8 authored by Leigh Stoller's avatar Leigh Stoller

Need to explicitly extend the slice if we force the duration too high.

Right now I am doing this as an extra operation, it could be rolled
into the initial createsliver.
parent 42c55f45
...@@ -1315,6 +1315,22 @@ sub CreateSliver($) ...@@ -1315,6 +1315,22 @@ sub CreateSliver($)
print STDERR "CreateSliver $urn: No manifest returned\n"; print STDERR "CreateSliver $urn: No manifest returned\n";
return -1; return -1;
} }
#
# This needs to be done differently; passing an extra credential
# and setting the valid_until in the rspec.
#
if ($duration > $maxduration) {
print "Forcing correct slice expiration\n";
$response = $aggobj->Extend($slice->ExpirationGMT(), $this_user);
if (!defined($response) ||
$response->code() != GENIRESPONSE_SUCCESS) {
$aggobj->SetStatus("failed");
$webtask->output("Renew failed on $urn");
$webtask->Exited(-1);
print STDERR "Renew failed on $urn\n";
return -1;
}
}
$aggobj->SetStatus("provisioned"); $aggobj->SetStatus("provisioned");
$aggobj->SetManifest($manifest); $aggobj->SetManifest($manifest);
return 0; return 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