Commit f9252918 authored by Leigh Stoller's avatar Leigh Stoller

Allow a portal created dataset that resides locally to be approved, but

poke the portal so it knows that happened.
parent 08ffb7ff
......@@ -62,6 +62,7 @@ sub notifyuser($$$);
#
my $TB = "@prefix@";
my $TBOPS = "@TBOPSEMAIL@";
my $MANAGE_DATASET = "$TB/bin/manage_dataset";
#
# Testbed Support libraries
......@@ -73,6 +74,7 @@ use Lease;
use Project;
use Group;
use User;
use APT_Dataset;
#
# Turn off line buffering on output
......@@ -153,9 +155,7 @@ $lease = Lease->Lookup($pid, $gid, $lname);
if (!$lease) {
fatal("$pid/$lname: lease does not exist.");
}
if (!$lease->AccessCheck($this_user, LEASE_ACCESS_MODIFY())) {
fatal("$pid/$lname: you are not allowed to modify lease.");
}
my $aptdataset = APT_Dataset->LookupByRemoteUUID($lease->uuid());
# Acquire the lease lock before we start making state changes.
if (!defined($waittime)) {
......@@ -229,7 +229,15 @@ if ($rv != LEASE_ERROR_NONE()) {
if ($background) {
unlink($logname);
}
#
# If a Portal created dataset, approved from outside the Portal interface,
# we want to poke things so that the web UI sees the change. Not super
# important, I know. Ignore failure of course.
#
if (defined($aptdataset)) {
system("$MANAGE_DATASET refresh -p ".
$aptdataset->pid() . "/" . $aptdataset->dataset_id());
}
$lease->Unlock();
print "$pid/$lname: approved, state is now '$state'\n";
......
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