mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #26899 from twangboy/fix_26730
file.symlink gets windows account instead of root
This commit is contained in:
commit
20a48f7f2e
1 changed files with 8 additions and 0 deletions
|
@ -835,6 +835,14 @@ def symlink(
|
|||
user = __opts__['user']
|
||||
|
||||
if salt.utils.is_windows():
|
||||
|
||||
# Make sure the user exists in Windows
|
||||
# Salt default is 'root'
|
||||
if not __salt__['user.info'](user):
|
||||
# User not found, use the account salt is running under
|
||||
# If username not found, use System
|
||||
user = os.getenv('username', 'System')
|
||||
|
||||
if group is not None:
|
||||
log.warning(
|
||||
'The group argument for {0} has been ignored as this '
|
||||
|
|
Loading…
Add table
Reference in a new issue