Commit b8f62a44 authored by Leigh Stoller's avatar Leigh Stoller

Do not allow lack of experiment directory to keep swapout from

proceeding, this is a great way to overstay your expiration, and that
makes the reservation system unhappy.
parent 72e313f4
#!/usr/bin/perl -wT
#
# Copyright (c) 2000-2017 University of Utah and the Flux Group.
# Copyright (c) 2000-2018 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -338,8 +338,28 @@ if (my $instance = Template::Instance->LookupByExptidx($experiment->idx())) {
" $pid/$eid is a template instance; use another command\n");
}
}
#
# Verify user and get his DB uid and other info for later.
#
my $this_user = User->ThisUser();
if (! defined($this_user)) {
tbdie("You ($UID) do not exist!");
}
my $user_dbid = $this_user->dbid();
my $user_uid = $this_user->uid();
my $user_name = $this_user->name();
my $user_email = $this_user->email();
my $isadmin = TBAdmin();
# Sanity check.
if ($inout eq "out" && ! (-e $workdir && -e $userdir && -e $infodir)) {
#
# Okay, lets try to recover. If this works, then the tests below
# will all succeed. If it fails, well then we fail.
#
print STDERR "Missing a critical directory, trying to recover ...\n";
$experiment->CreateDirectory();
}
if (! -e $workdir) {
die("*** $0:\n".
" $pid/$eid is missing a critical directory!\n" .
......@@ -372,19 +392,6 @@ if ($genimode) {
$experiment->SetState(EXPTSTATE_ACTIVE);
}
#
# Verify user and get his DB uid and other info for later.
#
my $this_user = User->ThisUser();
if (! defined($this_user)) {
tbdie("You ($UID) do not exist!");
}
my $user_dbid = $this_user->dbid();
my $user_uid = $this_user->uid();
my $user_name = $this_user->name();
my $user_email = $this_user->email();
my $isadmin = TBAdmin();
#
# Get email address of the swapper/creator, which may be different than
# the person who is actually terminating the experiment, since its polite
......
<?php
#
# Copyright (c) 2006-2017 University of Utah and the Flux Group.
# Copyright (c) 2006-2018 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -714,6 +714,7 @@ class Experiment
$exp_swapuid = $exprow["expt_swap_uid"];
$exp_end = $exprow["expt_end"];
$exp_created = $exprow["expt_created"];
$exp_expires = $exprow["expt_expires"];
$exp_head = $exprow["expt_head_uid"];
$exp_swapper = $exprow["swapper_idx"];
$exp_state = $exprow["state"];
......@@ -941,6 +942,12 @@ class Experiment
</tr>\n";
if (ISADMIN()) {
if ($exp_expires) {
echo "<tr>
<td>Expires: </td>
<td class=\"left\">$exp_expires</td>
</tr>\n";
}
echo "<tr>
<td>Idle Ignore:</td>
<td class=\"left\">$idle_ignore</td>
......
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