1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Remove whitespace from unix group names

This commit is contained in:
Bart van Bragt 2015-07-30 15:10:43 +02:00 committed by Toshio Kuratomi
parent c8e16793bf
commit d0e3d75381

View file

@ -552,7 +552,7 @@ class User(object):
if self.groups is None: if self.groups is None:
return None return None
info = self.user_info() 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): for g in set(groups):
if not self.group_exists(g): if not self.group_exists(g):
self.module.fail_json(msg="Group %s does not exist" % (g)) self.module.fail_json(msg="Group %s does not exist" % (g))