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

Small changes to allow deleting individual image versions at the IMS.

parent cd080069
...@@ -2586,11 +2586,11 @@ sub SetRunsOnNodeType($$) ...@@ -2586,11 +2586,11 @@ sub SetRunsOnNodeType($$)
# #
# If using the image tracker, have to notify the IMS. # If using the image tracker, have to notify the IMS.
# #
sub SchedIMSDeletion($) sub SchedIMSDeletion($$)
{ {
my ($self) = @_; my ($self,$allversions) = @_;
my $urn = $self->urn(); my $urn = $self->urn();
my $uuid = $self->image_uuid(); my $uuid = ($allversions ? $self->image_uuid() : $self->uuid());
# The expire daemon will pick this up. # The expire daemon will pick this up.
DBQueryWarn("replace into image_deletions set ". DBQueryWarn("replace into image_deletions set ".
......
...@@ -967,11 +967,11 @@ sub SetRunsOnNodeType($$) ...@@ -967,11 +967,11 @@ sub SetRunsOnNodeType($$)
# #
# If using the image tracker, have to notify the IMS. # If using the image tracker, have to notify the IMS.
# #
sub SchedIMSDeletion($) sub SchedIMSDeletion($$)
{ {
my ($self) = @_; my ($self,$allversions) = @_;
return $self->image()->SchedIMSDeletion(); return $self->image()->SchedIMSDeletion($allversions);
} }
# #
......
...@@ -418,7 +418,7 @@ exit(0) ...@@ -418,7 +418,7 @@ exit(0)
if (!$versonly) { if (!$versonly) {
# Do this before delete(). # Do this before delete().
if (GetSiteVar("protogeni/use_imagetracker")) { if (GetSiteVar("protogeni/use_imagetracker")) {
$image->SchedIMSDeletion() == 0 $image->SchedIMSDeletion(1) == 0
or fatal("Could not schedule IMS deletion"); or fatal("Could not schedule IMS deletion");
} }
if ($image->Delete() != 0) { if ($image->Delete() != 0) {
...@@ -429,6 +429,11 @@ if (!$versonly) { ...@@ -429,6 +429,11 @@ if (!$versonly) {
"been deleted by $this_user\n"); "been deleted by $this_user\n");
} }
else { else {
# Do this before delete().
if (GetSiteVar("protogeni/use_imagetracker")) {
$image->SchedIMSDeletion(0) == 0
or fatal("Could not schedule IMS deletion");
}
if ($image->DeleteVersion() != 0) { if ($image->DeleteVersion() != 0) {
fatal("Could not delete image version!"); fatal("Could not delete image version!");
} }
......
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