Commit b338ccaf authored by Leigh B Stoller's avatar Leigh B Stoller

Add internal function to forcibly terminate the local part of an

experiment.
parent 5fbcaba1
......@@ -144,6 +144,7 @@ sub WriteCredentials();
sub StartMonitor();
sub StartMonitorInternal(;$);
sub DoImageTrackerStuff($$$$$$$);
sub DoDestroy();
sub DenyExtensionInternal($);
sub ExtendInternal($$$$$);
sub CallMethodOnAggregates($$$@);
......@@ -222,6 +223,9 @@ elsif ($action eq "consoleurl") {
elsif ($action eq "terminate") {
DoTerminate()
}
elsif ($action eq "destroy") {
DoDestroy()
}
elsif ($action eq "schedterminate") {
DoSchedTerminate()
}
......@@ -1388,6 +1392,40 @@ sub DoTerminate()
exit($exitcode);
}
#
# Destroy. Do not use this!
#
sub DoDestroy()
{
my $expired = $RECORDHISTORY_TERMINATED;
if (@ARGV) {
my $arg = shift(@ARGV);
if ($arg eq "-e") {
$expired = $RECORDHISTORY_EXPIRED;
}
else {
usage();
}
}
my $slice = $instance->GetGeniSlice();
if (!defined($slice)) {
#
# No slice (typically) means we never got far enough to the
# get the sliver created on the backend cluster.
#
goto killit;
}
$instance->SetStatus("terminated");
$slice->Delete();
$instance->RecordHistory($expired);
killit:
$instance->Delete();
exit(0);
}
#
# Request an extension; all this code used to be in PHP, that was silly.
#
......
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