mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #40045 from terminalmage/fix-windows-user-present
Fix error when chhome is invoked by user.present state in Windows
This commit is contained in:
commit
2f28ec26ee
1 changed files with 4 additions and 4 deletions
|
@ -502,16 +502,16 @@ def present(name,
|
|||
continue
|
||||
# run chhome once to avoid any possible bad side-effect
|
||||
if key == 'home' and 'homeDoesNotExist' not in changes:
|
||||
if __grains__['kernel'] == 'Darwin':
|
||||
if __grains__['kernel'] in ('Darwin', 'Windows'):
|
||||
__salt__['user.chhome'](name, val)
|
||||
else:
|
||||
__salt__['user.chhome'](name, val, False)
|
||||
__salt__['user.chhome'](name, val, persist=False)
|
||||
continue
|
||||
if key == 'homeDoesNotExist':
|
||||
if __grains__['kernel'] == 'Darwin':
|
||||
if __grains__['kernel'] in ('Darwin', 'Windows'):
|
||||
__salt__['user.chhome'](name, val)
|
||||
else:
|
||||
__salt__['user.chhome'](name, val, True)
|
||||
__salt__['user.chhome'](name, val, persist=True)
|
||||
if not os.path.isdir(val):
|
||||
__salt__['file.mkdir'](val, pre['uid'], pre['gid'], 0o755)
|
||||
continue
|
||||
|
|
Loading…
Add table
Reference in a new issue