From 07ef8c4d84be02a2eba91a82198b824cebf694ce Mon Sep 17 00:00:00 2001 From: rishid Date: Thu, 1 Aug 2013 21:19:11 -0400 Subject: [PATCH] Verify groups string is not empty before trying add user to groups --- library/system/user | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/system/user b/library/system/user index 53e2a29298..26b16f0ccf 100644 --- a/library/system/user +++ b/library/system/user @@ -279,7 +279,7 @@ class User(object): cmd.append('-g') cmd.append(self.group) - if self.groups is not None: + if self.groups is not None and len(self.groups): groups = self.get_groups_set() cmd.append('-G') cmd.append(','.join(groups)) @@ -1221,7 +1221,7 @@ class AIX(User): cmd.append('-g') cmd.append(self.group) - if self.groups is not None: + if self.groups is not None and len(self.groups): groups = self.get_groups_set() cmd.append('-G') cmd.append(','.join(groups))