- cluster_state.each_value do |role_state|
if %(#{role_state["roles"]}) == role
endreturn role_state end
if all condition is false, you should also have return value. otherwise, return value will be "cluster_state".
Hash[key] will raise an exception if key is nonexistent. Here raising the exception or returning 'role_state'.
Thanks, RenWen
Thanks, Liushaofei
end
2.23.0