Browse Source

Add check if there is no default gateway

Do not try to return the default gateway data
if there is no default gateway.

Change-Id: I68b62b12cce2730ece968cede98b8f1597281fc5
Closes-Bug: 1655595
tags/11.0.0.0rc1
Dmitry Ilyin 2 years ago
parent
commit
5ea2e3cc75
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