Permalink
Browse files

make filter script more resilient

  • Loading branch information...
1 parent 9ad6c13 commit abd8139e1622833df88e35574a105b18ad11ec19 Vadim Spivak committed Mar 31, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 misc/filter
View
@@ -10,7 +10,7 @@ ARGF.each do |line|
if /DEBUG -- : RECEIVED: director./ =~ line
json = line[line.index("{")..-1]
message = Yajl::Parser.parse(json)
- if message["value"] && message["value"]["job_state"]
+ if message["value"] && message["value"].kind_of?(Hash) && message["value"]["job_state"]
spec = message["value"]
result[[spec["job"]["name"], spec["index"]]] = "#{spec["networks"].collect{ |name, network| network["ip"] + ((network["default"] && network["default"].include?("gateway")) ? "(*)" : "")}.join(", ")}" if spec["configuration_hash"]
end

0 comments on commit abd8139

Please sign in to comment.