[master/rhel7-branch] Fix PWQError issue when checking TUI passwords. (#1066988)

Samantha N. Bueno sbueno+anaconda at redhat.com
Thu Sep 18 18:32:43 UTC 2014


PWQErrors are tuples, so when we raise PWQError, we should also treat
it as a tuple, or else incur a traceback when trying to fetch/display
an error message.

Related: rhbz#1066988
---
 pyanaconda/ui/tui/spokes/__init__.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pyanaconda/ui/tui/spokes/__init__.py b/pyanaconda/ui/tui/spokes/__init__.py
index 3b48a2a..b40b08f 100644
--- a/pyanaconda/ui/tui/spokes/__init__.py
+++ b/pyanaconda/ui/tui/spokes/__init__.py
@@ -124,7 +124,8 @@ class EditTUIDialog(NormalTUISpoke):
                     return None
                 strength = checkPassword(pw)
                 if strength < 50:
-                    raise PWQError("The password you have provided is weak.")
+                    # this is so stupid
+                    raise PWQError(-1, "The password you have provided is weak.")
             except PWQError as e:
                 error = _("You have provided a weak password: %s. ") % e[1]
                 error += _("\nWould you like to use it anyway?")
-- 
1.9.3



More information about the anaconda-patches mailing list