Commit 9c1c3093 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Improvements to previous revision. Send email to the user when their

dataset has finished allocation. Also take the lock in the parent before
going into the background, since that is the only way we know that
allocation is in progress. Don't like it.
parent 2933f4a9
......@@ -388,6 +388,15 @@ if (defined($quota)) {
if ($approveme) {
my $logname;
# We want to have the lock before going into the background, so that
# the caller knows right away.
if ($lease->Lock()) {
print STDERR
"WARNING: could not lock new lease, contact testbed-ops.\n";
$approveme = 0;
goto noapprove;
if ($background) {
print "Resource allocation proceeding the background ...\n";
......@@ -395,11 +404,13 @@ if ($approveme) {
if (my $childpid = TBBackGround($logname)) {
# We want the lock in the child.
# Let parent exit;
if ($lease->Lock() || $lease->AllocResources("valid")) {
print STDERR "WARNING: could not approve new lease, contact testbed-ops.\n";
if ($lease->AllocResources("valid")) {
print STDERR "WARNING: could not allocate resources, contact testbed-ops.\n";
$approveme = 0;
......@@ -412,11 +423,16 @@ if ($approveme) {
$TBOPS, undef, $logname);
if ($lease->GotLock());
if ($background);
if ($background) {
"Your dataset is now ready to use",
"Dataset '$lname' is now allocated and ready to use.\n",
print "Created lease '$pid/$lname' for " . $descrip{$dstype};
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