From 461858e476f31aa764018549348d3a818e649f80 Mon Sep 17 00:00:00 2001 From: Raul Melo Date: Tue, 27 Aug 2013 16:17:33 +0200 Subject: [PATCH] Fix issue 3908. There was some ilegal operations over the sets --- library/system/user | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/library/system/user b/library/system/user index 26b16f0ccf..49dfcac9ec 100644 --- a/library/system/user +++ b/library/system/user @@ -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')