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

Bug fix: watch for slices with no experiment created yet.

parent e5eb478c
...@@ -409,18 +409,25 @@ sub ExpireSlices() ...@@ -409,18 +409,25 @@ sub ExpireSlices()
} }
else { else {
if ($slice->isplaceholder()) { if ($slice->isplaceholder()) {
print STDERR "Releasing placeholder $slice $experiment.\n"; print STDERR "Releasing placeholder $slice";
print STDERR " - $experiment"
if (defined($experiment));
print STDERR "\n";
} }
else { else {
print STDERR "Expiring $slice $experiment.\n"; print STDERR "Expiring $slice";
print STDERR " - $experiment"
if (defined($experiment));
print STDERR "\n";
} }
} }
cleanup: cleanup:
my $slice_uuid = $slice->uuid(); my $slice_uuid = $slice->uuid();
my $output = emutil::ExecQuiet("$CLEANUPSLICE -f -m $slice_uuid"); my $output = emutil::ExecQuiet("$CLEANUPSLICE -f -m $slice_uuid");
my $status = $?; my $status = $?;
my $logfile = Logfile->CreateFromString($experiment->gid_idx(), if (defined($experiment)) {
$output); my $gid_idx = $experiment->gid_idx();
my $logfile = Logfile->CreateFromString($gid_idx, $output);
if (defined($logfile)) { if (defined($logfile)) {
$logfile->SetMetadata([["slice_idx", $slice->idx()], $logfile->SetMetadata([["slice_idx", $slice->idx()],
["slice_urn", $slice->urn()], ["slice_urn", $slice->urn()],
...@@ -430,6 +437,10 @@ sub ExpireSlices() ...@@ -430,6 +437,10 @@ sub ExpireSlices()
], 1); ], 1);
$logfile->Store(); $logfile->Store();
} }
}
else {
print STDERR "$output\n";
}
if ($?) { if ($?) {
print STDERR "Could not release $slice\n"; print STDERR "Could not release $slice\n";
SENDMAIL($TBOPS, "Could not release slice $slice", SENDMAIL($TBOPS, "Could not release slice $slice",
...@@ -443,6 +454,8 @@ sub ExpireSlices() ...@@ -443,6 +454,8 @@ sub ExpireSlices()
skip: skip:
$slice->Flush() $slice->Flush()
if (defined($slice)); if (defined($slice));
$experiment->Flush()
if (defined($experiment));
} }
} }
......
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