Browse Source

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
tags/11.0.0.0rc1
Alexey Elagin 2 years ago
parent
commit
b8a2f95f0f
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      agent

+ 2
- 1
agent View File

@@ -1208,11 +1208,12 @@ class NodeAgent
1208 1208
   end
1209 1209
 
1210 1210
   def _get_pci_dev_list
1211
+    return {} if `cat /etc/nailgun_systemtype` != 'bootstrap'
1211 1212
     lshw_timeout = @settings['lshw_timeout'] || 60
1212 1213
     Timeout::timeout(lshw_timeout) do
1213 1214
       lshw_path = `which lshw`.chomp
1214 1215
       if $?.success?
1215
-        data = `#{lshw_path} -json`
1216
+        data = `#{lshw_path} -json -sanitize`
1216 1217
         return JSON.parse(data) if $?.success?
1217 1218
         @logger.warn("Can't get data from lshw. Reason: lshw exited with status #{$?.exitstatus}")
1218 1219
       else

Loading…
Cancel
Save