[PATCH] If spokes are not complete in command line mode, let the user know which.
Chris Lumens
clumens at redhat.com
Wed Nov 20 21:01:03 UTC 2013
> diff --git a/pyanaconda/ui/tui/hubs/summary.py b/pyanaconda/ui/tui/hubs/summary.py
> index 2d9ff29..7b332a3 100644
> --- a/pyanaconda/ui/tui/hubs/summary.py
> +++ b/pyanaconda/ui/tui/hubs/summary.py
> @@ -55,11 +55,16 @@ class SummaryHub(TUIHub):
> # override the prompt so that we can skip user input on kickstarts
> # where all the data is in hand. If not in hand, do the actual prompt.
> def prompt(self, args=None):
> - if flags.automatedInstall and \
> - all(spoke.completed for spoke in self._keys.values() if spoke.mandatory):
> + incompleteSpokes = [spoke for spoke in self._keys.values()
> + if spoke.mandatory and not spoke.completed]
> +
> + if flags.automatedInstall and not incompleteSpokes:
> self.close()
> return None
> +
> if not flags.ksprompt:
> - errtxt = _("Can't have a question in command line mode!")
> + errtxt = _("In command line mode, the following mandatory spokes are not completed:") + \
> + "\n" + " ".join(spoke.title for spoke in incompleteSpokes)
> raise RuntimeError(errtxt)
Now that I think about it, I'm going to change the string separator to ", "
since there might be spaces in the spoke titles.
- Chris
More information about the anaconda-patches
mailing list