mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #23672 from twangboy/fix_user_present
Fix user present
This commit is contained in:
commit
d322a19213
1 changed files with 8 additions and 0 deletions
|
@ -545,6 +545,14 @@ def present(name,
|
|||
' {1}'.format(name, expire)
|
||||
ret['result'] = False
|
||||
ret['changes']['expire'] = expire
|
||||
elif salt.utils.is_windows():
|
||||
if password and not empty_password:
|
||||
if not __salt__['user.setpassword'](name, password):
|
||||
ret['comment'] = 'User {0} created but failed to set' \
|
||||
' password to' \
|
||||
' {1}'.format(name, password)
|
||||
ret['result'] = False
|
||||
ret['changes']['passwd'] = password
|
||||
else:
|
||||
ret['comment'] = 'Failed to create new user {0}'.format(name)
|
||||
ret['result'] = False
|
||||
|
|
Loading…
Add table
Reference in a new issue