Commit 3bb68ffa authored by Jonathon Duerig's avatar Jonathon Duerig
Browse files

Allow slice credentials in update calls.

parent 890bb3a9
......@@ -3014,17 +3014,25 @@ sub SliverWorkAux($$$$$$$$)
my $slice;
if ($isupdate) {
# Lookup by sliver (if provided with sliver credential)
$aggregate = GeniAggregate->Lookup($credential->target_urn());
if (!defined($aggregate)) {
return GeniResponse->Create(GENIRESPONSE_BADARGS, undef,
"Sliver cannot be found");
if (defined($aggregate)) {
$slice = $aggregate->GetSlice();
} else {
# Otherwise, this might be a slice credential
$slice = GeniSlice->Lookup($credential->target_urn());
if (defined($slice)) {
$aggregate = GeniAggregate->SliceAggregate($slice);
}
}
$slice = $aggregate->GetSlice();
if (!defined($slice)) {
return GeniResponse->Create(GENIRESPONSE_ERROR, undef,
"No local slice found");
}
if (!defined($aggregate)) {
return GeniResponse->Create(GENIRESPONSE_ERROR, undef,
"No local sliver/aggregate found");
}
}
else {
$slice = GeniSlice->Lookup($credential->target_urn());
......
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