From 5e0cf6663afb8e6f8ca853c301bd59a93ea9c45f Mon Sep 17 00:00:00 2001 From: Sean Chittenden Date: Mon, 10 Feb 2014 13:08:53 -0800 Subject: [PATCH] Fix broken behavior when removing all auxiliary groups from a user (e.g. 'groups=' in the user module). --- library/system/user | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/system/user b/library/system/user index bf7af530b86..b0b23946765 100644 --- a/library/system/user +++ b/library/system/user @@ -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))