match interpreter on stdout also (#49446)
fixes #46980
(cherry picked from commit 758ac1846b
)
This commit is contained in:
parent
5b349773b0
commit
35f349ae10
2 changed files with 11 additions and 5 deletions
2
changelogs/fragments/detect_interpreter_stdout.yml
Normal file
2
changelogs/fragments/detect_interpreter_stdout.yml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- Also check stdout for interpreter errors for more intelligent messages to user
|
|
@ -890,12 +890,16 @@ class ActionBase(with_metaclass(ABCMeta, object)):
|
||||||
if res['stderr'].startswith(u'Traceback'):
|
if res['stderr'].startswith(u'Traceback'):
|
||||||
data['exception'] = res['stderr']
|
data['exception'] = res['stderr']
|
||||||
|
|
||||||
# try to figure out if we are missing interpreter
|
# The default
|
||||||
if self._used_interpreter is not None and '%s: No such file or directory' % self._used_interpreter.lstrip('!#') in data['module_stderr']:
|
data['msg'] = "MODULE FAILURE"
|
||||||
data['msg'] = "The module failed to execute correctly, you probably need to set the interpreter."
|
|
||||||
else:
|
|
||||||
data['msg'] = "MODULE FAILURE"
|
|
||||||
|
|
||||||
|
# try to figure out if we are missing interpreter
|
||||||
|
if self._used_interpreter is not None:
|
||||||
|
match = '%s: No such file or directory' % self._used_interpreter.lstrip('!#')
|
||||||
|
if match in data['module_stderr'] or match in data['module_stdout']:
|
||||||
|
data['msg'] = "The module failed to execute correctly, you probably need to set the interpreter."
|
||||||
|
|
||||||
|
# always append hint
|
||||||
data['msg'] += '\nSee stdout/stderr for the exact error'
|
data['msg'] += '\nSee stdout/stderr for the exact error'
|
||||||
|
|
||||||
if 'rc' in res:
|
if 'rc' in res:
|
||||||
|
|
Loading…
Reference in a new issue