diff options
-rw-r--r-- | debian/changelog | 6 | ||||
-rwxr-xr-x | site-summary | 9 |
2 files changed, 9 insertions, 6 deletions
diff --git a/debian/changelog b/debian/changelog index 5230a1e..a83860a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +sitesummary (0.0.71) unstable; urgency=low + + * Make sure 'site-summary -l' report handle hosts without a site set. + + -- Petter Reinholdtsen <pere@debian.org> Sat, 26 Nov 2011 21:52:32 +0100 + sitesummary (0.0.70) unstable; urgency=low [ Petter Reinholdtsen ] diff --git a/site-summary b/site-summary index 61b5dc9..9d77c53 100755 --- a/site-summary +++ b/site-summary @@ -31,8 +31,9 @@ sub handle_host { my $hostid = shift; #print "$hostid\n"; for my $site (get_site($hostid)) { - $site = "" unless defined $site; + $site = "SiteMissing" unless defined $site; $sites{$site}++; + $hostmap{$site} = [] unless exists $hostmap{$site}; my $sitegroup = get_sitegroup($hostid); if ($sitegroup) { $sitegroups{$site}{$sitegroup}++; @@ -42,11 +43,7 @@ sub handle_host { $sitegroupmap{$site}{$sitegroup} = [$hostid]; } } else { - if (exists $hostmap{$site}) { - push @{$hostmap{$site}}, $hostid ; - } else { - $hostmap{$site} = [$hostid]; - } + push @{$hostmap{$site}}, $hostid ; } } } |