mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fix broken behavior when removing all auxiliary groups from a user
(e.g. 'groups=' in the user module).
This commit is contained in:
parent
bbda98a3ee
commit
5e0cf6663a
1 changed files with 1 additions and 1 deletions
|
@ -443,7 +443,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(self.groups.split(','))
|
groups = set(filter(None, self.groups.split(',')))
|
||||||
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))
|
||||||
|
|
Loading…
Reference in a new issue