diff --git a/system/user b/system/user index 53e2a292985..26b16f0ccf7 100644 --- a/system/user +++ b/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))