diff options
Diffstat (limited to 'site-summary')
-rwxr-xr-x | site-summary | 9 |
1 files changed, 3 insertions, 6 deletions
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 ; } } } |