From c8053349d10e4e09d2aa90fafb1ce3c4995cbce2 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sun, 24 Feb 2013 16:59:26 +0100 Subject: [PATCH] sort hash keys --- config/build-nagios | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/build-nagios b/config/build-nagios index 280542a..312ba87 100755 --- a/config/build-nagios +++ b/config/build-nagios @@ -130,12 +130,12 @@ $nrpe = Nrpe.new() # and also skips private keys (those starting with an underscore) def print_block(fd, kind, hash, exclude_keys) fd.puts "define #{kind} {" - hash.each_pair{ |key, value| + hash.keys.sort.each{ |key| next if key == '_extinfo' next if key == '_hostgroups' next if key == '_memberlist' next if exclude_keys.include? key - fd.puts " #{key} #{value}" + fd.puts " #{key} #{hash[key]}" } fd.puts "}" fd.puts -- 2.20.1