Fix location of the createhome disablement

This commit is contained in:
twangboy 2017-05-09 19:03:57 +00:00
parent 4143c6ad58
commit d9d3785f26

View File

@ -394,14 +394,8 @@ def present(name,
.. versionchanged:: 2015.8.0
'''
# First check if a password is set. If password is set, check if
# hash_password is True, then hash it.
if __grains__['kernel'] in ('Darwin', 'Windows'):
# createhome not supported on Windows or Mac
createhome = False
if password and hash_password:
log.debug('Hashing a clear text password')
password = __salt__['shadow.gen_password'](password)
@ -415,6 +409,10 @@ def present(name,
if homephone is not None:
homephone = sdecode(homephone)
# createhome not supported on Windows or Mac
if __grains__['kernel'] in ('Darwin', 'Windows'):
createhome = False
ret = {'name': name,
'changes': {},
'result': True,