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

+ 2
- 1
agent View File

@@ -1182,11 +1182,12 @@ class NodeAgent
1182 1182
   end
1183 1183
 
1184 1184
   def _get_pci_dev_list
1185
+    return {} if `cat /etc/nailgun_systemtype`.chomp != 'bootstrap'
1185 1186
     lshw_timeout = @settings['lshw_timeout'] || 60
1186 1187
     Timeout::timeout(lshw_timeout) do
1187 1188
       lshw_path = `which lshw`.chomp
1188 1189
       if $?.success?
1189
-        data = `#{lshw_path} -json`
1190
+        data = `#{lshw_path} -json -sanitize`
1190 1191
         return JSON.parse(data) if $?.success?
1191 1192
         @logger.warn("Can't get data from lshw. Reason: lshw exited with status #{$?.exitstatus}")
1192 1193
       else

Loading…
Cancel
Save