Commit 5e0cf666 by Sean Chittenden

Fix broken behavior when removing all auxiliary groups from a user

(e.g. 'groups=' in the user module).
parent bbda98a3
......@@ -443,7 +443,7 @@ class User(object):
if self.groups is None:
return None
info = self.user_info()
groups = set(self.groups.split(','))
groups = set(filter(None, self.groups.split(',')))
for g in set(groups):
if not self.group_exists(g):
self.module.fail_json(msg="Group %s does not exist" % (g))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment