Commit af5c4bf9 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Watch for rspec using a deleted image and return error message.

parent 0115ea3b
...@@ -1168,6 +1168,15 @@ sub Action($$$;$) ...@@ -1168,6 +1168,15 @@ sub Action($$$;$)
if (!$isloaded || $reload) { if (!$isloaded || $reload) {
my $image = $osinfo->MapToImage("pcvm"); my $image = $osinfo->MapToImage("pcvm");
if (defined($image)) { if (defined($image)) {
#
# For now, not allowed to use a deleted image.
# Revisit later.
#
if (defined($image->deleted())) {
$msg = "$vnode needs to load $image, ".
"but it has been deleted";
goto bad;
}
print STDERR "Setting $vnode to load $image\n"; print STDERR "Setting $vnode to load $image\n";
if (!exists($reloads{$image->versid()})) { if (!exists($reloads{$image->versid()})) {
...@@ -1299,6 +1308,15 @@ sub Action($$$;$) ...@@ -1299,6 +1308,15 @@ sub Action($$$;$)
$msg .= " No image for $osinfo on $node"; $msg .= " No image for $osinfo on $node";
goto bad; goto bad;
} }
#
# For now, not allowed to use a deleted image.
# Revisit later.
#
if (defined($image->deleted())) {
$msg = "$node needs to load $image, ".
"but it has been deleted";
goto bad;
}
if (!exists($reloads{$image->versid()})) { if (!exists($reloads{$image->versid()})) {
$reloads{$image->versid()} = [ ]; $reloads{$image->versid()} = [ ];
} }
...@@ -1760,6 +1778,8 @@ sub Action($$$;$) ...@@ -1760,6 +1778,8 @@ sub Action($$$;$)
# Mark the offending sliver as failed. # Mark the offending sliver as failed.
if (defined($sliver)) { if (defined($sliver)) {
$sliver->SetStatus("failed"); $sliver->SetStatus("failed");
$sliver->SetErrorLog($msg)
if (defined($msg));
} }
return -1; return -1;
} }
......
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