From 0c9d8954385190268be6e194207da0f5e0f27fd4 Mon Sep 17 00:00:00 2001 From: Levi Morales Date: Tue, 30 Aug 2016 04:59:04 -0500 Subject: [PATCH] Fixes #2322 fix for missing append check on Darwin systems (#4256) --- lib/ansible/modules/system/user.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/ansible/modules/system/user.py b/lib/ansible/modules/system/user.py index 7776b2e4a14..d2449003e8b 100644 --- a/lib/ansible/modules/system/user.py +++ b/lib/ansible/modules/system/user.py @@ -1548,12 +1548,13 @@ class DarwinUser(User): else: target = set([]) - for remove in current - target: - (_rc, _err, _out) = self.__modify_group(remove, 'delete') - rc += rc - out += _out - err += _err - changed = True + if self.append is False: + for remove in current - target: + (_rc, _err, _out) = self.__modify_group(remove, 'delete') + rc += rc + out += _out + err += _err + changed = True for add in target - current: (_rc, _err, _out) = self.__modify_group(add, 'add')