[master 1/1] Fix 0 choice in Language and Storage in TUI mode
jkonecny12
installerbot-noreply at redhat.com
Thu May 14 14:49:37 UTC 2015
From: Jiri Konecny <jkonecny at redhat.com>
There were missing tests for the 0 user choice.
---
pyanaconda/ui/tui/spokes/langsupport.py | 2 ++
pyanaconda/ui/tui/spokes/storage.py | 2 ++
2 files changed, 4 insertions(+)
diff --git a/pyanaconda/ui/tui/spokes/langsupport.py b/pyanaconda/ui/tui/spokes/langsupport.py
index 175840f..0ae6bdd 100644
--- a/pyanaconda/ui/tui/spokes/langsupport.py
+++ b/pyanaconda/ui/tui/spokes/langsupport.py
@@ -98,6 +98,8 @@ def input(self, args, key):
""" Handle user input. """
try:
keyid = int(key) - 1
+ if keyid < 0:
+ return key
if args:
self._selected = args[keyid]
self.apply()
diff --git a/pyanaconda/ui/tui/spokes/storage.py b/pyanaconda/ui/tui/spokes/storage.py
index ca78f9b..ee006bf 100644
--- a/pyanaconda/ui/tui/spokes/storage.py
+++ b/pyanaconda/ui/tui/spokes/storage.py
@@ -263,6 +263,8 @@ def input(self, args, key):
self.errors = []
try:
keyid = int(key) - 1
+ if keyid < 0:
+ return key
self.selection = keyid
if len(self.disks) > 1 and keyid == len(self.disks):
self._select_all_disks()
--
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/819ba7374f80fc1ac30a43442ed22cd21c4b817f
More information about the anaconda-patches
mailing list