Skip to content

Commit 2b857ce

Browse files
author
RINGOT Patrice
committed
Merge branch 'kavlanng_sort' into 'master'
[kavlanngg5k] force order of the top level entries of the site level... See merge request grid5000/reference-repository!369
2 parents 022a41c + db0fbb9 commit 2b857ce

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/refrepo/gen/puppet/kavlanngg5k.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,12 @@ def gen_json(output_path)
4747
end
4848
# consistent order
4949
site_data_hierarchy['sites'] = site_data_hierarchy['sites'].sort_by { |site_id, _site_h| site_id }.to_h
50-
site_data_hierarchy['sites'].each { |_site_id, site_h|
50+
site_data_hierarchy['sites'].each { |site_id, site_h|
5151
site_h['clusters'] = site_h['clusters'].sort_by { |cluster_id, _cluster_h| cluster_id }.to_h
5252
site_h['clusters'].each { |_cluster_id, cluster_h|
5353
cluster_h['nodes'] = cluster_h['nodes'].sort_by { |node_id, _node_h| node_id[/(\d+)/].to_i }.to_h
5454
}
55+
site_data_hierarchy['sites'][site_id] = site_h.sort_by { |key| key}.to_h
5556
}
5657

5758
output_file = File.new(output_path, 'w')

0 commit comments

Comments
 (0)