minor fixes, also handle 'values' passed to dscl

pull/38842/head
Brian Coca 7 years ago committed by Brian Coca
parent 790a117b21
commit 1d58585945

@ -44,6 +44,7 @@ options:
description: description:
- Darwin/OS X only, optionally hide the user from the login window and system preferences. - Darwin/OS X only, optionally hide the user from the login window and system preferences.
- The default will be 'True' if the I(system) option is used. - The default will be 'True' if the I(system) option is used.
version_added: "2.6"
non_unique: non_unique:
description: description:
- Optionally when used with the -u option, this option allows to - Optionally when used with the -u option, this option allows to
@ -1521,6 +1522,23 @@ class DarwinUser(User):
('hidden', 'IsHidden'), ('hidden', 'IsHidden'),
] ]
def __init__(self, module):
super(DarwinUser, self).__init__(module)
# make the user hidden if option is set or deffer to system option
if self.hidden is None:
if self.system:
self.hidden = 1
elif self.hidden:
self.hidden = 1
else:
self.hidden = 0
# add hidden to processing if set
if self.hidden is not None:
self.fields.append(('hidden', 'IsHidden'))
def _get_dscl(self): def _get_dscl(self):
return [self.module.get_bin_path('dscl', True), self.dscl_directory] return [self.module.get_bin_path('dscl', True), self.dscl_directory]

Loading…
Cancel
Save