Browse Source

Handle absent manufacturer field correctly

The section can be absent on some BIOSes. Agent must not fail in this
case.

Change-Id: I931e4c7f3549fc82663f6a6ccfb51b5c4e912fe7
Closes-Bug: #1643192
Georgy Kibardin 2 years ago
parent
commit
ac5c37be5c
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      agent

+ 2
- 2
agent View File

@@ -1045,10 +1045,10 @@ class NodeAgent
1045 1045
   def _manufacturer
1046 1046
     if _is_virtualbox
1047 1047
       @facter['productname']
1048
-    elsif (@facter['manufacturer'].upcase != 'QEMU' && @facter['is_virtual'])
1048
+    elsif (@facter.fetch('manufacturer', '').upcase != 'QEMU' && @facter['is_virtual'])
1049 1049
       @facter['virtual']
1050 1050
     else
1051
-      @facter['manufacturer']
1051
+      @facter.fetch('manufacturer', '')
1052 1052
     end
1053 1053
   end
1054 1054
 

Loading…
Cancel
Save