Merge "Add lshw output to 'meta' hash"
This commit is contained in:
commit
92ebd5ade6
19
agent
19
agent
|
@ -274,6 +274,7 @@ class NodeAgent
|
||||||
},
|
},
|
||||||
:disks => [],
|
:disks => [],
|
||||||
:memory => (_dmi_memory or _ohai_memory),
|
:memory => (_dmi_memory or _ohai_memory),
|
||||||
|
:pci_devices => _get_pci_dev_list,
|
||||||
}
|
}
|
||||||
|
|
||||||
admin_mac = (_master_ip_and_mac[:mac] or @os[:macaddress]) rescue nil
|
admin_mac = (_master_ip_and_mac[:mac] or @os[:macaddress]) rescue nil
|
||||||
|
@ -786,6 +787,24 @@ class NodeAgent
|
||||||
res
|
res
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def _get_pci_dev_list
|
||||||
|
lshw_path = `which lshw`.chomp
|
||||||
|
exitstatus = $?
|
||||||
|
if exitstatus == 0
|
||||||
|
data = `#{lshw_path} -json`
|
||||||
|
exitstatus = $?
|
||||||
|
if exitstatus == 0
|
||||||
|
return JSON.parse(data)
|
||||||
|
else
|
||||||
|
@logger.warn("Can't get data from lshw. Reason: lshw exited with status #{exitstatus}")
|
||||||
|
end
|
||||||
|
else
|
||||||
|
@logger.warn("Can't find lshw. Reason: 'which lshw' returned exit status #{exitstatus}")
|
||||||
|
end
|
||||||
|
rescue => e
|
||||||
|
@logger.warn("Can't get data from lshw. Reason: #{e.message}")
|
||||||
|
end
|
||||||
|
|
||||||
def update_state
|
def update_state
|
||||||
@node_state = nil
|
@node_state = nil
|
||||||
if File.exist?("/etc/nailgun_systemtype")
|
if File.exist?("/etc/nailgun_systemtype")
|
||||||
|
|
|
@ -11,6 +11,7 @@ Vcs-Browser: https://github.com/stackforge/fuel-nailgun-agent
|
||||||
Package: nailgun-agent
|
Package: nailgun-agent
|
||||||
Architecture: all
|
Architecture: all
|
||||||
XB-Ruby-Versions: ${ruby:Versions}
|
XB-Ruby-Versions: ${ruby:Versions}
|
||||||
|
Recommends: lshw
|
||||||
Depends: ohai (<< 7),
|
Depends: ohai (<< 7),
|
||||||
dmidecode,
|
dmidecode,
|
||||||
ethtool,
|
ethtool,
|
||||||
|
|
Loading…
Reference in New Issue