Any suggestions how to fix this in a better way are more than welcome.
Vratislav Podzimek (1): Make Software spoke ready even if there is no repo (#1010348)
pyanaconda/ui/tui/spokes/software.py | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-)
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@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 """
On Tue, Sep 24, 2013 at 01:53:55PM -0400, Vratislav Podzimek wrote:
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@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
Like clumens mentioned in irc, we probably don't want to be too hasty with calling self.payload.baseRepo since that grabs yum lock.
Anyway, gonna NAK this patch, sorry. The real issue I see is a little deeper in the TUI code. In pyanaconda.ui.tui.hubs.summary: def setup(self, environment="anaconda"): TUIHub.setup(self, environment=environment)
if flags.automatedInstall: sys.stdout.write(_("Starting automated install")) sys.stdout.flush() spokes = self._keys.values() while not all(spoke.ready for spoke in spokes): sys.stdout.write('.') sys.stdout.flush() time.sleep(1)
That while loop is the problem; the software spoke is never being set to ready since self.payload.baseRepo never gets set, so we never break from the loop since it's just waiting on that.
However, we need to have self.payload.baseRepo checked somewhere; in the GUI this is done when checking if the spoke is ready, and I think that's the best place for it.
What we can do is either fix this in the software spoke or fix the hub code. I can't think of a good way to fix this in the hub right now though; the logic in gui verus tui is quite different, and I think changes to the hub would be more intrusive. I'd rather avoid that for rhel7-branch at this point.
So that's where I am at the moment; I think it might be easier to solve this in the spoke instead of the hub and am playing around with ideas that aren't working yet. If you have any suggestions though, feel free to share.
Samantha
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
anaconda-patches mailing list anaconda-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
anaconda-patches@lists.fedorahosted.org