[PATCH 1/3] Use ksdata to determine text password completeness

Vratislav Podzimek vpodzime at redhat.com
Wed Sep 19 07:55:14 UTC 2012


What if the user wants an empty root password ("")?

On Tue, 2012-09-18 at 13:08 -0700, Jesse Keating wrote:
> This is necessary for doing installs via kickstart where we've got the
> data even though we haven't gone through the spoke.
> 
> Also handle the case where the account could be locked.
> ---
>  pyanaconda/ui/tui/spokes/password.py | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/pyanaconda/ui/tui/spokes/password.py b/pyanaconda/ui/tui/spokes/password.py
> index 98da8ac..b556af2 100644
> --- a/pyanaconda/ui/tui/spokes/password.py
> +++ b/pyanaconda/ui/tui/spokes/password.py
> @@ -21,6 +21,7 @@
>  
>  from pyanaconda.ui.tui.spokes import NormalTUISpoke
>  from pyanaconda.ui.tui.simpleline import TextWidget
> +from pyanaconda.flags import flags
>  import getpass
>  
>  import gettext
> @@ -37,14 +38,16 @@ class PasswordSpoke(NormalTUISpoke):
>  
>      @property
>      def completed(self):
> -        return True
> +        return bool(self.data.rootpw.password or self.data.rootpw.lock)
>  
>      @property
>      def status(self):
> -        if not self.data.rootpw.password:
> -            return _("Root account disabled.")
> -        else:
> +        if self.data.rootpw.password:
>              return _("Password is set.")
> +        elif self.data.rootpw.lock:
> +            return _("Root account is disabled.")
> +        else:
> +            return _("Password is not set.")
>  
>      def refresh(self, args = None):
>          NormalTUISpoke.refresh(self, args)

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list