Commit 13820101 authored by Jonathon Duerig's avatar Jonathon Duerig

Handle lack of osids or subosids on a node more gracefully.

parent d3943c15
...@@ -2261,20 +2261,22 @@ sub print_raw_osids ...@@ -2261,20 +2261,22 @@ sub print_raw_osids
sub print_osids sub print_osids
{ {
my ($osids_arg, $default) = @_; my ($osids_arg, $default) = @_;
my @osids = @{ $osids_arg }; if (defined ($osids_arg)) {
foreach my $os (@osids) { my @osids = @{ $osids_arg };
if (defined($osid_name{$os})) { foreach my $os (@osids) {
my $urn = GeniHRN::Generate($OURDOMAIN, "image", if (defined($osid_name{$os})) {
$osid_pid{$os} . "//" . $osid_name{$os}); my $urn = GeniHRN::Generate($OURDOMAIN, "image",
print "<disk_image "; $osid_pid{$os} . "//" . $osid_name{$os});
print "name=\"" . $urn . "\" "; print "<disk_image ";
print "os=\"" . $osid_os{$os} . "\" "; print "name=\"" . $urn . "\" ";
print "version=\"" . $osid_version{$os} . "\" "; print "os=\"" . $osid_os{$os} . "\" ";
print "description=\"" . $osid_description{$os} . "\" "; print "version=\"" . $osid_version{$os} . "\" ";
if (defined($default) && $os eq $default) { print "description=\"" . $osid_description{$os} . "\" ";
print "default=\"true\" "; if (defined($default) && $os eq $default) {
print "default=\"true\" ";
}
print "/>\n";
} }
print "/>\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