From d9d3785f26118f17bd33f344e3bbca1cfb987d15 Mon Sep 17 00:00:00 2001 From: twangboy Date: Tue, 9 May 2017 19:03:57 +0000 Subject: [PATCH] Fix location of the createhome disablement --- salt/states/user.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/salt/states/user.py b/salt/states/user.py index c0af41507c..fb5397910e 100644 --- a/salt/states/user.py +++ b/salt/states/user.py @@ -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,