mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-02 16:53:11 +00:00
Verify groups string is not empty before trying add user to groups
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user