Commit 57bb371e authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Change TypeList to handle deleted images (use nodetypes from the

descriptor). Stash the current typelist into the descriptor being cloned,
just before cloning (safety measure, until I fix the image update path).
parent 9ea6404b
......@@ -604,6 +604,14 @@ sub NewVersion($$$$)
}
$typelist = join(",", @types);
#
# Update the type list in the image being cloned. Better to do this
# when the types are changed, but this works too since no one uses
# this until the image is deleted.
#
DBQueryWarn("update image_versions set nodetypes='$typelist' ".
"where imageid='$osid' and version='$version'");
#
# Now reset a few things in each table.
#
......@@ -1553,9 +1561,19 @@ sub WaitLock($$)
sub TypeList($;$)
{
my ($self, $osinfo) = @_;
my @result = ();
#
# Deleted images stash a list in the descriptor.
#
if ($self->deleted()) {
if ($self->nodetypes()) {
@result = split(",", $self->nodetypes());
}
return @result;
}
require NodeType;
my @result = ();
my $imageid = $self->imageid();
my $clause = (defined($osinfo) ?
"and osid='" . $osinfo->osid() . "'" : "");
......
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