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:
parent
6128845b69
commit
f2b72e62c0
1 changed files with 10 additions and 8 deletions
|
@ -1674,6 +1674,7 @@ 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.
|
||||
if self.groups:
|
||||
(rc, _out, _err, changed) = self._modify_group()
|
||||
out += _out
|
||||
err += _err
|
||||
|
@ -1708,6 +1709,7 @@ class DarwinUser(User):
|
|||
err += _err
|
||||
changed = rc
|
||||
|
||||
if self.groups:
|
||||
(rc, _out, _err, _changed) = self._modify_group()
|
||||
out += _out
|
||||
err += _err
|
||||
|
|
Loading…
Reference in a new issue