mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-19 07:11:25 +00:00
fixed disappearing groups on OSX user module
Ensure that we don't try to modify the groups collection if groups are not specified
This commit is contained in:
@@ -1673,9 +1673,10 @@ class DarwinUser(User):
|
||||
self._update_system_user()
|
||||
# here we don't care about change status since it is a creation,
|
||||
# thus changed is always true.
|
||||
(rc, _out, _err, changed) = self._modify_group()
|
||||
out += _out
|
||||
err += _err
|
||||
if self.groups:
|
||||
(rc, _out, _err, changed) = self._modify_group()
|
||||
out += _out
|
||||
err += _err
|
||||
return (rc, err, out)
|
||||
|
||||
def modify_user(self):
|
||||
@@ -1707,12 +1708,13 @@ class DarwinUser(User):
|
||||
err += _err
|
||||
changed = rc
|
||||
|
||||
(rc, _out, _err, _changed) = self._modify_group()
|
||||
out += _out
|
||||
err += _err
|
||||
if self.groups:
|
||||
(rc, _out, _err, _changed) = self._modify_group()
|
||||
out += _out
|
||||
err += _err
|
||||
|
||||
if _changed is True:
|
||||
changed = rc
|
||||
if _changed is True:
|
||||
changed = rc
|
||||
|
||||
rc = self._update_system_user()
|
||||
if rc == 0:
|
||||
|
||||
Reference in New Issue
Block a user