Verify groups string is not empty before trying add user to groups

pull/4420/head
rishid 2013-08-01 21:19:11 -04:00
parent 0335d05f43
commit 07ef8c4d84
1 changed files with 2 additions and 2 deletions

View File

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