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 d93f99480c)
changes/02/388002/2
Alexey Elagin 2 years ago
parent
commit
d7f11710ce
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      agent

+ 2
- 1
agent View File

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

Loading…
Cancel
Save