Commit 092c8bfe authored by Leigh Stoller's avatar Leigh Stoller

When there is a parent pointer, enter an os_submap row.

parent 807e7c84
......@@ -61,6 +61,9 @@ sub fatal($);
sub UserError(;$);
sub escapeshellarg($);
# Set this is we need to instert an os_submap entry.
my $parentos;
#
# Parse command arguments. Once we return from getopts, all that should be
# left are the required arguments.
......@@ -442,13 +445,13 @@ if (exists($newimageid_args{"nextosid"})) {
}
# Ditto def_parentosid
if (exists($newimageid_args{"def_parentosid"})) {
my $nextos = OSinfo->Lookup($newimageid_args{"def_parentosid"});
$parentos = OSinfo->Lookup($newimageid_args{"def_parentosid"});
if (!defined($nextos)) {
if (!defined($parentos)) {
UserError("def_parentosid: Does not exist");
}
# Might be in pid,osname format.
$newimageid_args{"def_parentosid"} = $nextos->osid();
$newimageid_args{"def_parentosid"} = $parentos->osid();
}
#
......@@ -693,6 +696,13 @@ fatal("Could not create new Image!")
my $imageid = $new_image->imageid();
#
# Insert a submap entry.
#
if (defined($parentos)) {
$new_osinfo->SetRunsOnParent($parentos);
}
# The web interface requires this line to be printed.
print "IMAGE $imagename/$imageid has been created\n";
......
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