# File lib/mcollective/rpc/helpers.rb, line 14 def self.extract_hosts_from_json(json) hosts = JSON.parse(json) raise "JSON hosts list is not an array" unless hosts.is_a?(Array) hosts.map do |host| raise "JSON host list is not an array of Hashes" unless host.is_a?(Hash) raise "JSON host list does not have senders in it" unless host.include?("sender") host["sender"] end.uniq end