Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 6ef9a404 authored by Samir Noir's avatar Samir Noir :cheese:
Browse files

[gen/puppet/refapi-subset] sort by clusters and nodes names

parent e9ebe553
Branches
Tags
No related merge requests found
Pipeline #123350 passed
......@@ -24,7 +24,10 @@ def gen_json(site, output_path)
cluster_hash['nodes'].to_h.each do |node_uid, node_hash|
node_hash.delete_if { |key| key != 'software' }
end
cluster_hash['nodes'] = cluster_hash['nodes'].sort_by{|node_uid, _node_hash| node_uid[/(\d+)/].to_i }.to_h
end
site_data_hierarchy['sites'][site]['clusters'] = site_data_hierarchy['sites'][site]['clusters'].sort_by{ |cluster_uid, cluster_hash| cluster_uid }.to_h
output_file = File.new(output_path, 'w')
output_file.write(JSON.pretty_generate(site_data_hierarchy))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment