Commit 27968df9 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Fixes to make versioned parent os's work correctly.

parent 003c1dc4
...@@ -1341,21 +1341,21 @@ sub LoadVirtNodes($) ...@@ -1341,21 +1341,21 @@ sub LoadVirtNodes($)
# Map the parent_osname to an OSID now. # Map the parent_osname to an OSID now.
# #
if (defined($parent_osname) && $parent_osname ne "") { if (defined($parent_osname) && $parent_osname ne "") {
my $ospid = $pid; my $osinfo;
if ($parent_osname =~ /^(.*)\/(.*)$/) { if ($parent_osname =~ /^(.*)\/(.*)$/) {
$ospid = $1; $osinfo = OSinfo->Lookup($osname);
$parent_osname = $2;
} }
my $osinfo = OSinfo->Lookup("$ospid,$parent_osname"); else {
if (!defined($osinfo)) { $osinfo = OSinfo->LookupByName($pid, $parent_osname);
$osinfo = OSinfo->LookupByName($parent_osname); if (!defined($osinfo)) {
$osinfo = OSinfo->LookupByName($parent_osname);
}
if (!defined($osinfo)) { if (!defined($osinfo)) {
tberror({cause => 'user', type => 'primary', tberror({cause => 'user', type => 'primary',
severity => SEV_ERROR, severity => SEV_ERROR,
error => ['invalid_os', undef, $parent_osname, $pid]}, error => ['invalid_os', undef, $parent_osname, $pid]},
"Invalid parent OS $parent_osname in project $ospid!"); "Invalid parent OS $parent_osname in project $pid!");
return -1; return -1;
} }
} }
...@@ -1544,17 +1544,15 @@ sub LoadVirtNodes($) ...@@ -1544,17 +1544,15 @@ sub LoadVirtNodes($)
$vnode->_fixedvm(undef); $vnode->_fixedvm(undef);
next; next;
} }
my $osinfo;
if (defined($vnode->_parent_osinfo())) { if (defined($vnode->_parent_osinfo())) {
$osid = $vnode->_parent_osinfo()->osid(); $osinfo = $vnode->_parent_osinfo();
} }
else { else {
$osid = ($self->option("jail_osid") || $osinfo = OSinfo->Lookup($self->option("jail_osid") ||
$self->nodejailosid($vnode)); $self->nodejailosid($vnode));
} }
return -1
if (!defined($osid));
my $osinfo = OSinfo->Lookup($osid);
return -1 return -1
if (!defined($osinfo)); if (!defined($osinfo));
......
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