Add lshw output to 'meta' hash
Change-Id: I7678f2541a7c07ecba32720588b0fc3b32edeb4a
This commit is contained in:
parent
a33a58d378
commit
6cd2e6e5ac
19
agent
19
agent
|
@ -274,6 +274,7 @@ class NodeAgent
|
|||
},
|
||||
:disks => [],
|
||||
:memory => (_dmi_memory or _ohai_memory),
|
||||
:pci_devices => _get_pci_dev_list,
|
||||
}
|
||||
|
||||
admin_mac = (_master_ip_and_mac[:mac] or @os[:macaddress]) rescue nil
|
||||
|
@ -709,6 +710,24 @@ class NodeAgent
|
|||
res
|
||||
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
|
||||
@node_state = nil
|
||||
if File.exist?("/etc/nailgun_systemtype")
|
||||
|
|
|
@ -11,6 +11,7 @@ Vcs-Browser: https://github.com/stackforge/fuel-nailgun-agent
|
|||
Package: nailgun-agent
|
||||
Architecture: all
|
||||
XB-Ruby-Versions: ${ruby:Versions}
|
||||
Recommends: lshw
|
||||
Depends: ohai (<< 7),
|
||||
dmidecode,
|
||||
ethtool,
|
||||
|
|
Loading…
Reference in New Issue