anaconda/backport-Do-not-crash-on-network-device-link-with-wireless-de.patch
sun_hai_10 24c5cb5165 merge upstream patches
(cherry picked from commit f1906fbbe61510ae6bf00dabc87d2b4db52b2a50)
2023-12-23 19:42:27 +08:00

36 lines
1.2 KiB
Diff

From 8a77e3403cbd70f47c466612d6e130e0a79bd51b Mon Sep 17 00:00:00 2001
From: Radek Vykydal <rvykydal@redhat.com>
Date: Wed, 9 Mar 2022 12:51:43 +0100
Subject: [PATCH] Do not crash on network --device link with wireless device
(#2051235)
Conflict: NA
Reference: https://github.com/rhinstaller/anaconda/commit/8a77e3403cbd70f47c466612d6e130e0a79bd51b
---
pyanaconda/modules/network/nm_client.py | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/modules/network/nm_client.py b/pyanaconda/modules/network/nm_client.py
index c2384cb5d5..3cc28ec48e 100644
--- a/pyanaconda/modules/network/nm_client.py
+++ b/pyanaconda/modules/network/nm_client.py
@@ -995,8 +995,13 @@ def get_first_iface_with_link(nm_client, ifaces):
"""Find first iface having link (in lexicographical order)."""
for iface in sorted(ifaces):
device = nm_client.get_device_by_iface(iface)
- if device and device.get_carrier():
- return device.get_iface()
+ if device:
+ try:
+ carrier = device.get_carrier()
+ except AttributeError:
+ carrier = None
+ if carrier:
+ return device.get_iface()
return None
--
2.27.0