[master 1/1] Fix for "Kickstart installation fails..." (#1197960)

jkonecny12 installerbot-noreply at redhat.com
Wed May 6 15:49:35 UTC 2015


From: Jiri Konecny <jkonecny at redhat.com>

Network interfaces are read from NetworkManager via DBus but not all
interfaces must be registered when anaconda starts. This could result in
reading non-existing configuration file in initialization of Network
spoke.

This fix will dump configuration files for every new interface in every
refresh of the Network spoke.

Resolves: rhbz#1197960
---
 pyanaconda/ui/tui/spokes/network.py | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/pyanaconda/ui/tui/spokes/network.py b/pyanaconda/ui/tui/spokes/network.py
index 6c71dee..e29a0c8 100644
--- a/pyanaconda/ui/tui/spokes/network.py
+++ b/pyanaconda/ui/tui/spokes/network.py
@@ -33,6 +33,9 @@
 from pyanaconda.regexes import IPV4_PATTERN_WITHOUT_ANCHORS
 from pyanaconda.constants_text import INPUT_PROCESSED
 
+import logging
+log = logging.getLogger("anaconda")
+
 import re
 
 __all__ = ["NetworkSpoke"]
@@ -51,17 +54,27 @@ def __init__(self, app, data, storage, payload, instclass):
         self.errors = []
 
     def initialize(self):
-        for name in nm.nm_devices():
+        self._load_new_devices()
+
+        EditTUISpoke.initialize(self)
+        if not self.data.network.seen:
+            self._update_network_data()
+
+    def _load_new_devices(self):
+        devices = nm.nm_devices()
+        intf_dumped = network.dumpMissingDefaultIfcfgs()
+        if intf_dumped:
+            log.debug("Dumped interfaces: %s", intf_dumped)
+
+        for name in devices:
+            if name in self.supported_devices:
+                continue
             if nm.nm_device_type_is_ethernet(name):
                 # ignore slaves
                 if nm.nm_device_setting_value(name, "connection", "slave-type"):
                     continue
                 self.supported_devices.append(name)
 
-        EditTUISpoke.initialize(self)
-        if not self.data.network.seen:
-            self._update_network_data()
-
     @property
     def completed(self):
         """ Check whether this spoke is complete or not. Do an additional
@@ -126,6 +139,7 @@ def _activated_device_msg(self, devname):
 
     def refresh(self, args=None):
         """ Refresh screen. """
+        self._load_new_devices()
         EditTUISpoke.refresh(self, args)
 
         # on refresh check if we haven't got hostname from NM on activated


-- 
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/05e5dbae048bf336ba4929a260c3490519350b40


More information about the anaconda-patches mailing list