[Kimchi-devel] [PATCH] list host user names as less a possible

Aline Manera alinefm at linux.vnet.ibm.com
Tue Aug 12 00:16:42 UTC 2014


Reviewed-by: Aline Manera <alinefm at linux.vnet.ibm.com>

On 08/11/2014 01:04 PM, shaohef at linux.vnet.ibm.com wrote:
> From: Simon Jin <simonjin at linux.vnet.ibm.com>
>
> The backend should fitler the user name who can not login the shell.
>
> Signed-off-by: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
> Signed-off-by: Simon Jin <simonjin at linux.vnet.ibm.com>
> ---
>   src/kimchi/model/host.py | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/kimchi/model/host.py b/src/kimchi/model/host.py
> index a1f8944..39f45d8 100644
> --- a/src/kimchi/model/host.py
> +++ b/src/kimchi/model/host.py
> @@ -419,7 +419,8 @@ def __init__(self, **kargs):
>           pass
>
>       def get_list(self):
> -        return [user.pw_name for user in pwd.getpwall()]
> +        return [user.pw_name for user in pwd.getpwall()
> +                if user.pw_shell.rsplit("/")[-1] not in ["nologin", "false"]]
>
>
>   class GroupsModel(object):




More information about the Kimchi-devel mailing list