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
(cherry picked from commit 1dd3dd64bf)
changes/94/405294/1
Alexey Elagin 2 years ago
parent
commit
27ad2910a4
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      agent

+ 2
- 1
agent View File

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

Loading…
Cancel
Save