aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetter Reinholdtsen <pere@hungry.com>2011-11-26 20:54:18 +0000
committerPetter Reinholdtsen <pere@hungry.com>2011-11-26 20:54:18 +0000
commit46d887265b844cf29b39de210f2bd494a178cb4c (patch)
tree07ec8be5ef4184f57c08660abeac0423ce1b4f94
parent455bf45c129101b0427eeb2024c36c5d6275fdce (diff)
downloadsitesummary-46d887265b844cf29b39de210f2bd494a178cb4c.tar.gz
sitesummary-46d887265b844cf29b39de210f2bd494a178cb4c.tar.bz2
sitesummary-46d887265b844cf29b39de210f2bd494a178cb4c.tar.xz
Make sure 'site-summary -l' report handle hosts without a site set.
-rw-r--r--debian/changelog6
-rwxr-xr-xsite-summary9
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 ;
}
}
}