Merge pull request #5944 from sean-/devel

Fix broken behavior when removing all auxiliary groups from a user. See #5933 for more details.

Tests by hand correct and passes "make clean tests".
This commit is contained in:
Richard Isaacson 2014-02-13 13:54:38 -06:00
commit 686f87e42e

View file

@ -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))