fixed disappearing groups on OSX user module

Ensure that we don't try to modify the groups collection if groups are not specified
pull/18777/head
nitzmahone 9 years ago committed by Matt Clay
parent 5c05016d1e
commit 0d0b78dd1e

@ -1673,6 +1673,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
@ -1707,6 +1708,7 @@ class DarwinUser(User):
err += _err
changed = rc
if self.groups:
(rc, _out, _err, _changed) = self._modify_group()
out += _out
err += _err

Loading…
Cancel
Save