Change _get_pci_dev_list func

Add hostname check and run lshw only on bootstrap nodes.
Add sanitize param to lshw to hide any ip,mac etc

Change-Id: I7739da68ab059178787ff0fe2418a54717684750
Closes-Bug: #1554970
(cherry picked from commit d93f99480c)
This commit is contained in:
Alexey Elagin 2016-10-06 19:03:02 +03:00 committed by Sergii Rizvan
parent 9e716cbddc
commit d7f11710ce
1 changed files with 2 additions and 1 deletions

3
agent
View File

@ -792,10 +792,11 @@ class NodeAgent
end end
def _get_pci_dev_list def _get_pci_dev_list
return {} if `cat /etc/nailgun_systemtype`.chomp != 'bootstrap'
lshw_path = `which lshw`.chomp lshw_path = `which lshw`.chomp
exitstatus = $? exitstatus = $?
if exitstatus == 0 if exitstatus == 0
data = `#{lshw_path} -json` data = `#{lshw_path} -json -sanitize`
exitstatus = $? exitstatus = $?
if exitstatus == 0 if exitstatus == 0
return JSON.parse(data) return JSON.parse(data)