From d0e3d75381292fc7bf417598f9f6542a7fcd2d07 Mon Sep 17 00:00:00 2001 From: Bart van Bragt Date: Thu, 30 Jul 2015 15:10:43 +0200 Subject: [PATCH] Remove whitespace from unix group names --- lib/ansible/modules/system/user.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/system/user.py b/lib/ansible/modules/system/user.py index ba072e3902..49a71d99a7 100644 --- a/lib/ansible/modules/system/user.py +++ b/lib/ansible/modules/system/user.py @@ -552,7 +552,7 @@ class User(object): if self.groups is None: return None info = self.user_info() - groups = set(filter(None, self.groups.split(','))) + groups = set([x.strip() for x in self.groups.split(',') if x]) for g in set(groups): if not self.group_exists(g): self.module.fail_json(msg="Group %s does not exist" % (g))