Permalink
Browse files

Modify the link addition code to handle the nil public case.

  • Loading branch information...
galthaus committed Mar 1, 2012
1 parent b5222dd commit db4720f5af92069f195a66a467908722ee57d54a
Showing with 4 additions and 3 deletions.
  1. +4 −3 crowbar_framework/app/models/ganglia_service.rb
@@ -62,10 +62,11 @@ def transition(inst, name, state)
tnodes.each do |n|
next if n.nil?
node = NodeObject.find_node_by_name(n)
- if node.get_network_by_type("public")["address"].nil? or node.get_network_by_type("public")["address"].empty?
- server_ip = node.get_network_by_type("admin")["address"]
+ pub = node.get_network_by_type("public")
+ if pub and pub["address"] and pub["address"] != ""
+ server_ip = pub["address"]
else
- server_ip = node.get_network_by_type("public")["address"]
+ server_ip = node.get_network_by_type("admin")["address"]
end
end
end

0 comments on commit db4720f

Please sign in to comment.