From c892f510023b340c92b2f84b8f6c0df17cd62940 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). --- system/user | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/user b/system/user index bf7af530b86..b0b23946765 100644 --- a/system/user +++ b/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))