Allow excluding a host twice
[mirror/dsa-nagios.git] / config / build-nagios
index 13c3d4c..545e4fd 100755 (executable)
@@ -239,9 +239,9 @@ def find_hosts(service, servers, hostgroups)
        hosts        = merge_hosts_and_hostgroups service, servers, hostgroups, ''
        excludehosts = merge_hosts_and_hostgroups service, servers, hostgroups, 'exclude'
 
-       excludehosts.each{ |host|
+       excludehosts.uniq.each{ |host|
                if hosts.delete(host) == nil
-                       throw "Cannot remove host #{host} from service #{service['service_description']}: it's not included anyway or excluded twice."
+                       throw "Cannot remove host #{host} from service #{service['service_description']}: it's not included anyway."
                end
        }