mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fix issue 3908. There was some ilegal operations over the sets
This commit is contained in:
parent
8ec806905d
commit
461858e476
1 changed files with 15 additions and 11 deletions
|
@ -1273,20 +1273,24 @@ class AIX(User):
|
|||
|
||||
if self.groups is not None:
|
||||
current_groups = self.user_group_membership()
|
||||
groups = self.get_groups_set()
|
||||
group_diff = set(current_groups).symmetric_difference(groups)
|
||||
groups_need_mod = False
|
||||
groups = []
|
||||
|
||||
if group_diff:
|
||||
if self.append:
|
||||
for g in groups:
|
||||
if g in group_diff:
|
||||
groups.extend(current_groups)
|
||||
set(groups)
|
||||
groups_need_mod = True
|
||||
break
|
||||
else:
|
||||
if self.groups == '':
|
||||
if current_groups and not self.append:
|
||||
groups_need_mod = True
|
||||
else:
|
||||
groups = self.get_groups_set()
|
||||
group_diff = set(current_groups).symmetric_difference(groups)
|
||||
|
||||
if group_diff:
|
||||
if self.append:
|
||||
for g in groups:
|
||||
if g in group_diff:
|
||||
groups_need_mod = True
|
||||
break
|
||||
else:
|
||||
groups_need_mod = True
|
||||
|
||||
if groups_need_mod:
|
||||
cmd.append('-G')
|
||||
|
|
Loading…
Reference in a new issue