def get_private_networks()
so = shell_out('xenstore-ls vm-data/networking')
if so.exitstatus == 0
networks = []
so.stdout.split("\n").map{|l| l.split('=').first.strip }.map do |item|
_so = shell_out("xenstore-read vm-data/networking/#{item}")
if _so.exitstatus == 0
networks.push(FFI_Yajl::Parser.new.parse(_so.stdout))
else
Ohai::Log.debug('Unable to capture custom private networking information for Rackspace cloud')
return false
end
end
networks.delete_if { |hash| hash['label'] == 'private' }
networks.delete_if { |hash| hash['label'] == 'public' }
end
rescue Errno::ENOENT
Ohai::Log.debug('Unable to capture custom private networking information for Rackspace cloud')
nil
end