Skip to content

Commit

Permalink
Merge pull request #46588 from UtahDave/no_crash_winshell
Browse files Browse the repository at this point in the history
Don't crash when saltwinshell is missing
  • Loading branch information
Mike Place authored Mar 21, 2018
2 parents 33af3cf + b7842a1 commit 4e7466a
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion salt/client/ssh/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
from salt.ext.six.moves import input # pylint: disable=import-error,redefined-builtin
try:
import saltwinshell
HAS_WINSHELL = False
HAS_WINSHELL = True
except ImportError:
HAS_WINSHELL = False
try:
Expand Down Expand Up @@ -470,6 +470,19 @@ def handle_ssh(self, mine=False):
self.targets[host][default] = self.defaults[default]
if 'host' not in self.targets[host]:
self.targets[host]['host'] = host
if self.targets[host].get('winrm') and not HAS_WINSHELL:
returned.add(host)
rets.add(host)
log_msg = 'Please contact [email protected] for access to the enterprise saltwinshell module.'
log.debug(log_msg)
no_ret = {'fun_args': [],
'jid': None,
'return': log_msg,
'retcode': 1,
'fun': '',
'id': host}
yield {host: no_ret}
continue
args = (
que,
self.opts,
Expand Down

0 comments on commit 4e7466a

Please sign in to comment.