Commit f1fce167 authored by Jonathon Duerig's avatar Jonathon Duerig
Browse files

Trims the list of advertised OSIDs in ProtoGENI based on db.

Default OSID is printed as well. But I will need a special case for RHL-STD
parent 28aae882
...@@ -407,7 +407,7 @@ if (defined($pid)) { ...@@ -407,7 +407,7 @@ if (defined($pid)) {
# 1) To avoid an explosion in the number of features for nodes # 1) To avoid an explosion in the number of features for nodes
# 2) To avoid information leaks, allowing projects to see each other's images # 2) To avoid information leaks, allowing projects to see each other's images
# #
my $osidquery = "select distinct o.osid, oi.type, o.osname, o.pid, o.OS, o.version, o.description from os_info as o " . my $osidquery = "select distinct o.osid, oi.type, o.osname, o.pid, o.OS, o.version, o.description,o.protogeni_export from os_info as o " .
"left join osidtoimageid as oi on o.osid = oi.osid " . "left join osidtoimageid as oi on o.osid = oi.osid " .
"left join images as i on oi.imageid = i.imageid ". "left join images as i on oi.imageid = i.imageid ".
"where i.global = 1"; "where i.global = 1";
...@@ -447,14 +447,18 @@ my %node_latitudes; ...@@ -447,14 +447,18 @@ my %node_latitudes;
my %node_longitudes; my %node_longitudes;
$result = DBQueryFatal($osidquery); $result = DBQueryFatal($osidquery);
while (my ($osid,$type,$osname,$ospid,$osos, while (my ($osid,$type,$osname,$ospid,$osos,
$osversion,$osdescription) = $result->fetchrow()) { $osversion,$osdescription,$geni) = $result->fetchrow()) {
if ($typemap{$type}) { if ($typemap{$type}) {
push(@{ $typemap{$type}->{'OSLIST'} }, $osid); my $default = $typemap{$type}->{'OSID'};
$osid_name{$osid} = $osname; if ($geni eq 1 ||
$osid_pid{$osid} = $ospid; (defined($default) && $default eq $osid)) {
$osid_os{$osid} = $osos; push(@{ $typemap{$type}->{'OSLIST'} }, $osid);
$osid_version{$osid} = $osversion; $osid_name{$osid} = $osname;
$osid_description{$osid} = $osdescription; $osid_pid{$osid} = $ospid;
$osid_os{$osid} = $osos;
$osid_version{$osid} = $osversion;
$osid_description{$osid} = $osdescription;
}
} }
if ($node_type_osids{$type}) { if ($node_type_osids{$type}) {
push @{$node_type_osids{$type}}, $osid; push @{$node_type_osids{$type}}, $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