Commit 51e4c143 authored by Jonathon Duerig's avatar Jonathon Duerig

ptopgen now handles the RHL-STD OS gracefully when printing disk image info.

parent 3533283b
...@@ -415,6 +415,10 @@ if ($pid) { ...@@ -415,6 +415,10 @@ if ($pid) {
$osidquery .= " or i.pid='$pid'"; $osidquery .= " or i.pid='$pid'";
} }
my $defaultosidquery = 'select distinct o.osid, t.type, o.osname, o.pid, o.OS, o.version, o.description, o.protogeni_export '.
'from os_info as o left join node_type_attributes as t '.
'on (o.osid=t.attrvalue) where t.attrkey="default_osid"';
# #
# For subOS support (i.e., vnode OSes running atop vhost OSes), we have to # For subOS support (i.e., vnode OSes running atop vhost OSes), we have to
# check both the subosid and all the parent_osid it can run on. # check both the subosid and all the parent_osid it can run on.
...@@ -434,45 +438,55 @@ if ($pid) { ...@@ -434,45 +438,55 @@ if ($pid) {
} }
$subosidquery .= ")"; $subosidquery .= ")";
my %node_type_osids; our %node_type_osids;
my %osid_node_types; our %osid_node_types;
my %osid_subosids; our %osid_subosids;
my %osid_name; our %osid_name;
my %osid_pid; our %osid_pid;
my %osid_os; our %osid_os;
my %osid_version; our %osid_version;
my %osid_description; our %osid_description;
my %node_countries; our %node_countries;
my %node_latitudes; our %node_latitudes;
my %node_longitudes; our %node_longitudes;
$result = DBQueryFatal($osidquery); $result = DBQueryFatal($osidquery);
while (my ($osid,$type,$osname,$ospid,$osos, processOs($result);
$osversion,$osdescription,$geni) = $result->fetchrow()) {
if ($typemap{$type}) { $result = DBQueryFatal($defaultosidquery);
my $default = $typemap{$type}->{'OSID'}; processOs($result);
if ($geni eq 1 ||
(defined($default) && $default eq $osid)) { sub processOs
push(@{ $typemap{$type}->{'OSLIST'} }, $osid); {
$osid_name{$osid} = $osname; my $result = shift(@_);
$osid_pid{$osid} = $ospid; while (my ($osid,$type,$osname,$ospid,$osos,
$osid_os{$osid} = $osos; $osversion,$osdescription,$geni) = $result->fetchrow()) {
$osid_version{$osid} = $osversion; if ($typemap{$type}) {
$osid_description{$osid} = $osdescription; my $default = $typemap{$type}->{'OSID'};
} if ($geni eq 1 ||
} (defined($default) && $default eq $osid)) {
if ($node_type_osids{$type}) { push(@{ $typemap{$type}->{'OSLIST'} }, $osid);
push @{$node_type_osids{$type}}, $osid; $osid_name{$osid} = $osname;
} else { $osid_pid{$osid} = $ospid;
$node_type_osids{$type} = [$osid]; $osid_os{$osid} = $osos;
} $osid_version{$osid} = $osversion;
# $osid_description{$osid} = $osdescription;
# We have to maintain a data structure telling us which types an OSID could }
# be on for use below with generic OSIDs }
# if ($node_type_osids{$type}) {
if ($osid_node_types{$osid}) { push @{$node_type_osids{$type}}, $osid;
push @{$osid_node_types{$osid}}, $type; } else {
} else { $node_type_osids{$type} = [$osid];
$osid_node_types{$osid} = [$type]; }
#
# We have to maintain a data structure telling us which types an OSID could
# be on for use below with generic OSIDs
#
if ($osid_node_types{$osid}) {
push @{$osid_node_types{$osid}}, $type;
} else {
$osid_node_types{$osid} = [$type];
}
} }
} }
# #
......
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