[PATCH 3/6] If an incorrect source is given for a ks install, don't fallback (#948212).

Chris Lumens clumens at redhat.com
Thu Apr 4 19:29:33 UTC 2013


The correct kickstart behavior here is to error and let the user change the
source themselves.  We should not fall back to the closest mirror or whatever.
Lots of these changes are to make the status message correct.
---
 pyanaconda/packaging/yumpayload.py | 7 ++++---
 pyanaconda/ui/gui/spokes/source.py | 4 ++--
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/pyanaconda/packaging/yumpayload.py b/pyanaconda/packaging/yumpayload.py
index ecd5598..1209f85 100644
--- a/pyanaconda/packaging/yumpayload.py
+++ b/pyanaconda/packaging/yumpayload.py
@@ -185,7 +185,7 @@ class YumPayload(PackagePayload):
         self._writeYumConfig()
         self._setup = True
 
-        self.updateBaseRepo()
+        self.updateBaseRepo(fallback=not flags.automatedInstall)
 
         # When setup is called, it's already in a separate thread. That thread
         # will try to select groups right after this returns, so make sure we
@@ -457,13 +457,14 @@ reposdir=%s
         # see if we can get a usable base repo from self.data.method
         try:
             self._configureBaseRepo(self.storage, checkmount=checkmount)
-        except PayloadError as e:
+        except (MetadataError, PayloadError) as e:
             if not fallback:
                 with _yum_lock:
                     for repo in self._yum.repos.repos.values():
                         if repo.enabled:
                             self.disableRepo(repo.id)
-                raise
+
+                return
 
             # this preserves the method details while disabling it
             self.data.method.method = None
diff --git a/pyanaconda/ui/gui/spokes/source.py b/pyanaconda/ui/gui/spokes/source.py
index 0a47679..fef1e2e 100644
--- a/pyanaconda/ui/gui/spokes/source.py
+++ b/pyanaconda/ui/gui/spokes/source.py
@@ -453,7 +453,7 @@ class SourceSpoke(NormalSpoke):
 
     @property
     def completed(self):
-        if flags.automatedInstall and not self.data.method.method:
+        if flags.automatedInstall and (not self.data.method.method or not self.payload.baseRepo):
             return False
         else:
             return not self._error and self.status and self.status != _("Nothing selected")
@@ -477,7 +477,7 @@ class SourceSpoke(NormalSpoke):
             return _("Checking software dependencies...")
         elif not self.ready:
             return _("Not ready")
-        elif self._error:
+        elif self._error or not self.payload.baseRepo:
             return _("Error setting up software source")
         elif self.data.method.method == "url":
             return self.data.method.url or self.data.method.mirrorlist
-- 
1.8.1.2



More information about the anaconda-patches mailing list