neil / rpms / anaconda

Forked from rpms/anaconda a year ago
Clone
ec9c66
From 5994e5ab09719656ca09a279e5b38f1ce3184d8d Mon Sep 17 00:00:00 2001
ec9c66
From: Radek Vykydal <rvykydal@redhat.com>
ec9c66
Date: Wed, 26 Aug 2020 09:52:24 +0200
ec9c66
Subject: [PATCH] network: do not crash on infiniband devices activated in
ec9c66
 initramfs
ec9c66
ec9c66
Resolves: rhbz#1890009
ec9c66
---
ec9c66
 pyanaconda/modules/network/initialization.py | 15 ++++++++-------
ec9c66
 1 file changed, 8 insertions(+), 7 deletions(-)
ec9c66
ec9c66
diff --git a/pyanaconda/modules/network/initialization.py b/pyanaconda/modules/network/initialization.py
ec9c66
index 5e33d0494..b27a46976 100644
ec9c66
--- a/pyanaconda/modules/network/initialization.py
ec9c66
+++ b/pyanaconda/modules/network/initialization.py
ec9c66
@@ -411,13 +411,14 @@ class DumpMissingIfcfgFilesTask(Task):
ec9c66
         s_con.set_property(NM.SETTING_CONNECTION_ID, iface)
ec9c66
         s_con.set_property(NM.SETTING_CONNECTION_INTERFACE_NAME, iface)
ec9c66
         s_wired = con.get_setting_wired()
ec9c66
-        # By default connections are bound to interface name
ec9c66
-        s_wired.set_property(NM.SETTING_WIRED_MAC_ADDRESS, None)
ec9c66
-        bound_mac = bound_hwaddr_of_device(self._nm_client, iface, self._ifname_option_values)
ec9c66
-        if bound_mac:
ec9c66
-            s_wired.set_property(NM.SETTING_WIRED_MAC_ADDRESS, bound_mac)
ec9c66
-            log.debug("%s: iface %s bound to mac address %s by ifname boot option",
ec9c66
-                      self.name, iface, bound_mac)
ec9c66
+        if s_wired:
ec9c66
+            # By default connections are bound to interface name
ec9c66
+            s_wired.set_property(NM.SETTING_WIRED_MAC_ADDRESS, None)
ec9c66
+            bound_mac = bound_hwaddr_of_device(self._nm_client, iface, self._ifname_option_values)
ec9c66
+            if bound_mac:
ec9c66
+                s_wired.set_property(NM.SETTING_WIRED_MAC_ADDRESS, bound_mac)
ec9c66
+                log.debug("%s: iface %s bound to mac address %s by ifname boot option",
ec9c66
+                          self.name, iface, bound_mac)
ec9c66
 
ec9c66
     @guard_by_system_configuration(return_value=[])
ec9c66
     def run(self):
ec9c66
-- 
ec9c66
2.21.1
ec9c66