Browse Source

Merge "Add check if there is no default gateway"

Jenkins 2 years ago
parent
commit
15310d6989
1 changed files with 5 additions and 3 deletions
  1. 5
    3
      agent

+ 5
- 3
agent View File

@@ -333,9 +333,11 @@ class NodeAgent
333 333
       iface = $2
334 334
     end
335 335
     result = _get_all_interfaces_info
336
-    result[:default_gateway] = gw
337
-    result[:default_interface] = iface
338
-    result[:mac] = @facter["macaddress_#{iface.gsub('-', '_')}"].upcase
336
+    if gw and iface
337
+      result[:default_gateway] = gw
338
+      result[:default_interface] = iface
339
+      result[:mac] = @facter["macaddress_#{iface.gsub('-', '_')}"].upcase
340
+    end
339 341
     result
340 342
   end
341 343
 

Loading…
Cancel
Save