mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add additional path to find ssh.exe
This commit is contained in:
parent
9c4fb42e5f
commit
0fa801a329
1 changed files with 10 additions and 5 deletions
|
@ -9,6 +9,7 @@ import copy
|
|||
import logging
|
||||
import os
|
||||
import re
|
||||
import glob
|
||||
from distutils.version import LooseVersion as _LooseVersion
|
||||
|
||||
# Import salt libs
|
||||
|
@ -205,11 +206,15 @@ def _git_run(command, cwd=None, user=None, password=None, identity=None,
|
|||
'git/ssh-id-wrapper'
|
||||
)
|
||||
if salt.utils.is_windows():
|
||||
for suffix in ('', ' (x86)'):
|
||||
ssh_exe = (
|
||||
'C:\\Program Files{0}\\Git\\bin\\ssh.exe'
|
||||
.format(suffix)
|
||||
)
|
||||
# Known locations for Git's ssh.exe in Windows
|
||||
globmasks = [os.path.join(os.getenv('SystemDrive'), os.sep,
|
||||
'Program Files*', 'Git', 'usr', 'bin',
|
||||
'ssh.exe'),
|
||||
os.path.join(os.getenv('SystemDrive'), os.sep,
|
||||
'Program Files*', 'Git', 'bin',
|
||||
'ssh.exe')]
|
||||
for globmask in globmasks:
|
||||
ssh_exe = glob.glob(globmask)
|
||||
if os.path.isfile(ssh_exe):
|
||||
env['GIT_SSH_EXE'] = ssh_exe
|
||||
break
|
||||
|
|
Loading…
Add table
Reference in a new issue