mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[libvirt] makes libvirt code more debian friendly
debian based libvirt does not know interfaces and some node information
This commit is contained in:
parent
0383957172
commit
ed6952fbf7
2 changed files with 5 additions and 3 deletions
|
@ -12,10 +12,10 @@ module Fog
|
|||
node_hash[param] = client.send(param) rescue nil
|
||||
end
|
||||
node_hash[:uri] = client.uri
|
||||
xml = client.sys_info
|
||||
xml = client.sys_info rescue nil
|
||||
[:uuid, :manufacturer, :product, :serial].each do |attr|
|
||||
node_hash[attr] = node_attr(attr, xml)
|
||||
end
|
||||
end if xml
|
||||
|
||||
node_hash[:hostname] = client.hostname
|
||||
[node_hash]
|
||||
|
|
|
@ -5,7 +5,9 @@ module Fog
|
|||
def list_interfaces(filter = { })
|
||||
data=[]
|
||||
if filter.keys.empty?
|
||||
(client.list_interfaces + client.list_defined_interfaces).each do |ifname|
|
||||
active_networks = client.list_interfaces rescue []
|
||||
defined_networks = client.list_defined_interfaces rescue []
|
||||
(active_networks + defined_networks).each do |ifname|
|
||||
data << interface_to_attributes(client.lookup_interface_by_name(ifname))
|
||||
end
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue