Skip to content

Commit

Permalink
Porting PR saltstack#49490 to 2019.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
garethgreenaway committed Sep 18, 2019
1 parent 8d4d5ea commit 25e40e1
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions salt/modules/cmdmod.py
Expand Up @@ -666,21 +666,12 @@ def _get_stripped(cmd):
except (OSError, IOError) as exc:
msg = (
'Unable to run command \'{0}\' with the context \'{1}\', '
'reason: '.format(
'reason: {2}'.format(
cmd if output_loglevel is not None else 'REDACTED',
new_kwargs
new_kwargs,
exc
)
)
try:
if exc.filename is None:
msg += 'command not found'
else:
msg += '{0}: {1}'.format(exc, exc.filename)
except AttributeError:
# Both IOError and OSError have the filename attribute, so this
# is a precaution in case the exception classes in the previous
# try/except are changed.
msg += 'unknown'
raise CommandExecutionError(msg)

try:
Expand Down

0 comments on commit 25e40e1

Please sign in to comment.