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

shaohef at linux.vnet.ibm.com shaohef at linux.vnet.ibm.com
Mon Aug 11 16:04:46 UTC 2014


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):
-- 
1.9.3




More information about the Kimchi-devel mailing list