Commit 249efdee authored by Leigh B. Stoller's avatar Leigh B. Stoller

Do not allow endexp and swapexp to be invoked on template instances

without the -x option (which is provided by template_swapin and
template_swapout). This will prevent users from swapping an instance
out via the xmlrpc interface; must use the proper template routines.
parent 74539278
......@@ -165,6 +165,17 @@ if (! $experiment) {
my $workdir = $experiment->WorkDir();
my $userdir = $experiment->UserDir();
#
# See if this is a template instance; error if the -x option not provided,
# since that means user is trying to self-terminate; not in the program.
#
if (my $instance = Template::Instance->LookupByExptidx($experiment->idx()))
if (! $template_mode) {
die("*** $0:\n".
" $pid/$eid is a template instance; use another command\n");
}
}
#
# Verify user and get his DB uid.
#
......
......@@ -285,6 +285,17 @@ if (! $experiment) {
my $workdir = $experiment->WorkDir();
my $userdir = $experiment->UserDir();
#
# See if this is a template instance; error if the -x option not provided,
# since that means user is trying to self-terminate; not in the program.
#
if (my $instance = Template::Instance->LookupByExptidx($experiment->idx()))
if (! $template_mode) {
die("*** $0:\n".
" $pid/$eid is a template instance; use another command\n");
}
}
#
# Verify user and get his DB uid.
#
......
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