[master/rhel7-branch] Show error on invalid username attempts in TUI. (#1171778)

Vratislav Podzimek vpodzime at redhat.com
Thu May 28 08:18:12 UTC 2015


On Wed, 2015-05-27 at 13:17 -0400, Samantha N. Bueno wrote:
> Previously, if a user entered an invalid username (e.g. "root"), no
> error was shown and the username "root" was simply not created. This
> could trouble users who were expecting a certain user to be created on
> their systems, but saw no indication that there was a problem.
> 
> Resolves: rhbz#1171778
> ---
>  pyanaconda/ui/tui/spokes/user.py | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/pyanaconda/ui/tui/spokes/user.py b/pyanaconda/ui/tui/spokes/user.py
> index 1c24d6d..7ef5b5d 100644
> --- a/pyanaconda/ui/tui/spokes/user.py
> +++ b/pyanaconda/ui/tui/spokes/user.py
> @@ -81,9 +81,16 @@ class UserSpoke(FirstbootSpokeMixIn, EditTUISpoke):
>          # so that all of the properties are set at once
>          self.args._password = ""
>  
> +        self.errors = []
> +
>      def refresh(self, args = None):
>          self.args._admin = "wheel" in self.args.groups
>          self.args._groups = ", ".join(self.args.groups)
> +
> +        # if we have any errors, display them
> +        while len(self.errors) > 0:
This could be just 'while self.errors'.

> +            print(self.errors.pop())
Do we want to print and discard the errors or keep them?

If the answer for the above question is "yes", ACK. :)

-- 
Vratislav Podzimek

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



More information about the anaconda-patches mailing list