From bd2cebc8abccd3df9143cdeee9e925040a75e1e8 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sun, 24 Feb 2013 17:12:32 +0100 Subject: [PATCH] sort more stuff --- config/build-nagios | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/build-nagios b/config/build-nagios index 7b2a7d6..a940b87 100755 --- a/config/build-nagios +++ b/config/build-nagios @@ -147,7 +147,7 @@ def merge_contacts(host, service) [host, service].each{ |source| contacts.push source[k] if source.has_key?(k) } - service[k] = contacts.join(",") unless contacts.empty? + service[k] = contacts.sort.join(",") unless contacts.empty? } end @@ -209,7 +209,7 @@ def addService(hosts, service, files, servers) set_complain_if_set service['_extinfo'], 'service_description' , service['service_description'], 'serviceextinfo', service['service_description'] - set_complain_if_set service['_extinfo'], 'host_name' , hosts.join(',') , 'serviceextinfo', service['service_description'] + set_complain_if_set service['_extinfo'], 'host_name' , hosts.sort.join(',') , 'serviceextinfo', service['service_description'] print_block files['serviceextinfo'], 'serviceextinfo', service['_extinfo'], %w() end @@ -365,8 +365,8 @@ config['hostgroups'].keys.sort.each{ |name| next if hg['private'] throw "Empty hostgroup #{name}" if hg['_memberlist'].length == 0 - set_complain_if_set hg, 'hostgroup_name', name , 'Hostgroup', name - set_complain_if_set hg, 'members' , hg['_memberlist'].join(","), 'Hostgroup', name + set_complain_if_set hg, 'hostgroup_name', name , 'Hostgroup', name + set_complain_if_set hg, 'members' , hg['_memberlist'].sort.join(","), 'Hostgroup', name print_block files['hostgroups'], 'hostgroup', hg, %w() } -- 2.20.1