[master/rhel7-branch] Fix PWQError issue when checking TUI passwords. (#1066988)
Anne Mulhern
amulhern at redhat.com
Thu Sep 18 19:33:31 UTC 2014
----- Original Message -----
> From: "Samantha N. Bueno" <sbueno+anaconda at redhat.com>
> To: anaconda-patches at lists.fedorahosted.org
> Sent: Thursday, September 18, 2014 2:32:43 PM
> Subject: [master/rhel7-branch] Fix PWQError issue when checking TUI passwords. (#1066988)
>
> 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
>
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
>
We should not really be raising a PWQError, it belongs to pwquality package.
Some other logic would be better here.
- mulhern
More information about the anaconda-patches
mailing list