1 Star 0 Fork 92

yanan-rock / anaconda

forked from src-openEuler / anaconda 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
bugfix-network-do-not-crash-when-updating-a-connection-with.patch 1.96 KB
一键复制 编辑 原始数据 按行查看 历史
xuxiaolong 提交于 2021-04-02 10:25 . sync 49 fixbug from github
From a3e46c49216f76f73097587b15ded52b253ce3d2 Mon Sep 17 00:00:00 2001
From: Radek Vykydal <rvykydal@redhat.com>
Date: Wed, 26 Aug 2020 09:52:24 +0200
Subject: [PATCH] network: do not crash when updating a connection without
wired settings
One of the Anaconda fallouts of NM defaulting to keyfiles.
Hit by team-pre and five other -pre kickstart tests.
---
pyanaconda/modules/network/initialization.py | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/pyanaconda/modules/network/initialization.py b/pyanaconda/modules/network/initialization.py
index 5e33d0494..b27a46976 100644
--- a/pyanaconda/modules/network/initialization.py
+++ b/pyanaconda/modules/network/initialization.py
@@ -411,13 +411,14 @@ class DumpMissingIfcfgFilesTask(Task):
s_con.set_property(NM.SETTING_CONNECTION_ID, iface)
s_con.set_property(NM.SETTING_CONNECTION_INTERFACE_NAME, iface)
s_wired = con.get_setting_wired()
- # By default connections are bound to interface name
- s_wired.set_property(NM.SETTING_WIRED_MAC_ADDRESS, None)
- bound_mac = bound_hwaddr_of_device(self._nm_client, iface, self._ifname_option_values)
- if bound_mac:
- s_wired.set_property(NM.SETTING_WIRED_MAC_ADDRESS, bound_mac)
- log.debug("%s: iface %s bound to mac address %s by ifname boot option",
- self.name, iface, bound_mac)
+ if s_wired:
+ # By default connections are bound to interface name
+ s_wired.set_property(NM.SETTING_WIRED_MAC_ADDRESS, None)
+ bound_mac = bound_hwaddr_of_device(self._nm_client, iface, self._ifname_option_values)
+ if bound_mac:
+ s_wired.set_property(NM.SETTING_WIRED_MAC_ADDRESS, bound_mac)
+ log.debug("%s: iface %s bound to mac address %s by ifname boot option",
+ self.name, iface, bound_mac)
@guard_by_system_configuration(return_value=[])
def run(self):
--
2.23.0
1
https://gitee.com/yanan-rock/anaconda.git
git@gitee.com:yanan-rock/anaconda.git
yanan-rock
anaconda
anaconda
master

搜索帮助