[PATCH] Make Software spoke ready even if there is no repo (#1010348)

Vratislav Podzimek vpodzime at redhat.com
Tue Sep 24 17:53:55 UTC 2013


Nothing can be done in the Software spoke if the repository is not set up, but
automated installations wait for all spokes to become ready which never happens
if there is no repo specified in the kickstart. The Software spoke thus needs to
inform user what to do, but has to be ready/visitable.

Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
 pyanaconda/ui/tui/spokes/software.py | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/pyanaconda/ui/tui/spokes/software.py b/pyanaconda/ui/tui/spokes/software.py
index 9b37f55..9d96e62 100644
--- a/pyanaconda/ui/tui/spokes/software.py
+++ b/pyanaconda/ui/tui/spokes/software.py
@@ -79,6 +79,8 @@ class SoftwareSpoke(NormalTUISpoke):
             return _("Error checking software selection")
         if not self.ready:
             return _("Processing...")
+        if self.payload.baseRepo is None:
+            return _("Installation source not set up")
         if not self.txid_valid:
             return _("Source changed - please verify")
 
@@ -107,14 +109,26 @@ class SoftwareSpoke(NormalTUISpoke):
                          not self.errors and self.txid_valid
 
         if flags.automatedInstall:
-            return processingDone and self.data.packages.seen
+            return processingDone and self.payload.baseRepo and self.data.packages.seen
         else:
-            return self.environment is not None and processingDone
+            return self.payload.baseRepo and self.environment is not None and processingDone
 
     def refresh(self, args=None):
         """ Refresh screen. """
         NormalTUISpoke.refresh(self, args)
 
+        if self.payload.baseRepo is None:
+            message = TextWidget(_("Installation source needs to be set up first."))
+            self._window.append(message)
+
+            # add some more space below
+            self._window.append(TextWidget(""))
+            return True
+
+        # put a title above the list and some space below it
+        self._window.append(TextWidget(_("Base environment")))
+        self._window.append(TextWidget(""))
+
         environments = self.payload.environments
 
         displayed = []
@@ -122,7 +136,6 @@ class SoftwareSpoke(NormalTUISpoke):
             name = self.payload.environmentDescription(env)[0]
 
             displayed.append(CheckboxWidget(title="%s" % name, completed=(environments.index(env) == self._selection)))
-        print(_("Base environment"))
 
         def _prep(i, w):
             """ Do some format magic for display. """
@@ -160,8 +173,7 @@ class SoftwareSpoke(NormalTUISpoke):
         """ If we're ready to move on. """
         return (not threadMgr.get(THREAD_SOFTWARE_WATCHER) and
                 not threadMgr.get(THREAD_PAYLOAD_MD) and
-                not threadMgr.get(THREAD_CHECK_SOFTWARE) and
-                self.payload.baseRepo is not None)
+                not threadMgr.get(THREAD_CHECK_SOFTWARE))
 
     def apply(self):
         """ Apply our selections """
-- 
1.7.11.7



More information about the anaconda-patches mailing list