From 91f619d5bd2b1e37a2fc5f956cb8bd17dd89d064 Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Mon, 4 Jan 2016 17:55:29 +0100 Subject: [PATCH] MT#17179 lib: sort host.keys Change-Id: I8070ace41cf8436e67fb94ba324b71a68593e231 (cherry picked from commit df1fc96f4a235b04990308d1d897921beacf3e11) --- lib/get_all_adv_ips | 2 +- lib/get_all_cluster_set_ip_maps | 2 +- lib/get_all_cluster_set_ip_maps_for_host | 2 +- lib/get_all_cluster_set_shared_ip_maps | 2 +- lib/get_all_cluster_set_shared_ip_maps_for_host | 2 +- lib/get_all_cluster_sets | 2 +- lib/get_all_hosts_ips | 2 +- lib/get_all_shared_ips | 2 +- lib/get_all_shared_v6ips | 2 +- lib/get_all_v6ips | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/get_all_adv_ips b/lib/get_all_adv_ips index 1a4c03ee..aa08bcf4 100644 --- a/lib/get_all_adv_ips +++ b/lib/get_all_adv_ips @@ -11,7 +11,7 @@ -%] [% blktmp.processed_hosts = {} -%] [% out = [] -%] -[% FOREACH host IN hosts.keys -%] +[% FOREACH host IN hosts.keys.sort -%] [% IF hosts.$host.role.grep('^' _ argv.role _ '$').size() && !blktmp.processed_hosts.$host.defined -%] [% FOREACH iface IN hosts.$host.interfaces -%] [% FOREACH realiface IN hosts.$host.keys -%] diff --git a/lib/get_all_cluster_set_ip_maps b/lib/get_all_cluster_set_ip_maps index 482453b0..1ce00f6e 100644 --- a/lib/get_all_cluster_set_ip_maps +++ b/lib/get_all_cluster_set_ip_maps @@ -14,7 +14,7 @@ theset = { dispatcher_id = cluster_sets.$set.dispatcher_id }; theset.ips = []; - FOREACH host IN hosts.keys; + FOREACH host IN hosts.keys.sort; NEXT UNLESS hosts.$host.role.grep('^' _ argv.role _ '$').size(); FOREACH iface IN hosts.$host.interfaces; NEXT UNLESS hosts.$host.$iface.cluster_sets.grep('^' _ set _ '$').size(); diff --git a/lib/get_all_cluster_set_ip_maps_for_host b/lib/get_all_cluster_set_ip_maps_for_host index 7d618428..935cbe1d 100644 --- a/lib/get_all_cluster_set_ip_maps_for_host +++ b/lib/get_all_cluster_set_ip_maps_for_host @@ -18,7 +18,7 @@ IF cluster_sets.type == 'central'; set_hosts = [ argv.host, hosts.${argv.host}.peer ]; ELSE; - set_hosts = hosts.keys; + set_hosts = hosts.keys.sort; END; diff --git a/lib/get_all_cluster_set_shared_ip_maps b/lib/get_all_cluster_set_shared_ip_maps index a9159446..8eb644ac 100644 --- a/lib/get_all_cluster_set_shared_ip_maps +++ b/lib/get_all_cluster_set_shared_ip_maps @@ -15,7 +15,7 @@ theset = { dispatcher_id = cluster_sets.$set.dispatcher_id }; theset.ips = []; - FOREACH host IN hosts.keys; + FOREACH host IN hosts.keys.sort; NEXT IF blktmp.processed_hosts.$host.defined; NEXT UNLESS hosts.$host.role.grep('^' _ argv.role _ '$').size(); peer = hosts.$host.peer; diff --git a/lib/get_all_cluster_set_shared_ip_maps_for_host b/lib/get_all_cluster_set_shared_ip_maps_for_host index 79c8f4ba..3d087e96 100644 --- a/lib/get_all_cluster_set_shared_ip_maps_for_host +++ b/lib/get_all_cluster_set_shared_ip_maps_for_host @@ -18,7 +18,7 @@ IF cluster_sets.type == 'central'; set_hosts = [ argv.host, hosts.${argv.host}.peer ]; ELSE; - set_hosts = hosts.keys; + set_hosts = hosts.keys.sort; END; diff --git a/lib/get_all_cluster_sets b/lib/get_all_cluster_sets index 66b9d97f..07d0f21d 100644 --- a/lib/get_all_cluster_sets +++ b/lib/get_all_cluster_sets @@ -10,7 +10,7 @@ FOREACH set IN cluster_sets.keys; NEXT IF (set == 'default_set' || set == 'type'); - FOREACH host IN hosts.keys; + FOREACH host IN hosts.keys.sort; NEXT UNLESS hosts.$host.role.grep('^' _ argv.type _ '$').size(); FOREACH iface IN hosts.$host.interfaces; NEXT UNLESS hosts.$host.$iface.cluster_sets.grep('^' _ set _ '$').size(); diff --git a/lib/get_all_hosts_ips b/lib/get_all_hosts_ips index 368f1429..26e08b77 100644 --- a/lib/get_all_hosts_ips +++ b/lib/get_all_hosts_ips @@ -14,7 +14,7 @@ # ] -%] [% out = [] -%] -[% FOREACH host IN hosts.keys -%] +[% FOREACH host IN hosts.keys.sort -%] [% IF hosts.$host.role.grep('^' _ argv.role _ '$').size() -%] [% FOREACH iface IN hosts.$host.interfaces -%] [% FOREACH realiface IN hosts.$host.keys -%] diff --git a/lib/get_all_shared_ips b/lib/get_all_shared_ips index f71d0a92..230c11da 100644 --- a/lib/get_all_shared_ips +++ b/lib/get_all_shared_ips @@ -11,7 +11,7 @@ -%] [% blktmp.processed_hosts = {} -%] [% out = [] -%] -[% FOREACH host IN hosts.keys -%] +[% FOREACH host IN hosts.keys.sort -%] [% IF hosts.$host.role.grep('^' _ argv.role _ '$').size() && !blktmp.processed_hosts.$host.defined -%] [% FOREACH iface IN hosts.$host.interfaces -%] [% FOREACH realiface IN hosts.$host.keys -%] diff --git a/lib/get_all_shared_v6ips b/lib/get_all_shared_v6ips index 5cda7ba6..4dd097f0 100644 --- a/lib/get_all_shared_v6ips +++ b/lib/get_all_shared_v6ips @@ -12,7 +12,7 @@ -%] [% blktmp.processed_hosts = {} -%] [% out = [] -%] -[% FOREACH host IN hosts.keys -%] +[% FOREACH host IN hosts.keys.sort -%] [% IF hosts.$host.role.grep('^' _ argv.role _ '$').size() && !blktmp.processed_hosts.$host.defined -%] [% FOREACH iface IN hosts.$host.interfaces -%] [% FOREACH realiface IN hosts.$host.keys -%] diff --git a/lib/get_all_v6ips b/lib/get_all_v6ips index fdaca91a..cd58e8b3 100644 --- a/lib/get_all_v6ips +++ b/lib/get_all_v6ips @@ -10,7 +10,7 @@ # @return out The array of ips -%] [% out = [] -%] -[% FOREACH host IN hosts.keys -%] +[% FOREACH host IN hosts.keys.sort -%] [% IF hosts.$host.role.grep('^' _ argv.role _ '$').size() -%] [% FOREACH iface IN hosts.$host.interfaces -%] [% FOREACH realiface IN hosts.$host.keys -%]