MT#17179 lib: sort host.keys

Change-Id: I8070ace41cf8436e67fb94ba324b71a68593e231
(cherry picked from commit df1fc96f4a)
changes/11/4011/1
Victor Seva 10 years ago committed by Alexander Lutay
parent 7893e05678
commit 91f619d5bd

@ -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 -%]

@ -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();

@ -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;

@ -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;

@ -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;

@ -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();

@ -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 -%]

@ -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 -%]

@ -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 -%]

@ -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 -%]

Loading…
Cancel
Save