Commit d6c01388 authored by MICHON Nicolas's avatar MICHON Nicolas
Browse files

[dev] cluster-homogeneity: fixed error if first node of a cluster is retired

parent 2719e5d7
...@@ -153,12 +153,19 @@ def cluster_homogeneity(refapi_hash, options = {:verbose => false}) ...@@ -153,12 +153,19 @@ def cluster_homogeneity(refapi_hash, options = {:verbose => false})
count[site_uid][cluster_uid] = 0 count[site_uid][cluster_uid] = 0
refnode_uid = cluster['nodes'].keys.sort.first refnode_uid = nil
refnode = cluster['nodes'][refnode_uid] refnode = nil
cluster["nodes"].each_sort_by_node_uid do |node_uid, node| cluster["nodes"].each_sort_by_node_uid do |node_uid, node|
next if node['status'] == 'retired' next if node['status'] == 'retired'
if !refnode
refnode = node
refnode_uid = node_uid
next
end
diffs = HashDiff.diff(refnode, node) diffs = HashDiff.diff(refnode, node)
# Hack HashDiff output for arrays: # Hack HashDiff output for arrays:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment