interpreter_discovery: Hide warning in auto_silent (#74509)
Hide warning "No python interpreters" in auto_silent mode. Fixes: #74274 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
parent
b0389c7f11
commit
4627c30b2e
2 changed files with 5 additions and 1 deletions
2
changelogs/fragments/74274_interpreter_discovery.yml
Normal file
2
changelogs/fragments/74274_interpreter_discovery.yml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- interpreter_discovery - hide warning 'No python interpreters...' when ANSIBLE_PYTHON_INTERPRETER=auto_silent (https://github.com/ansible/ansible/issues/74274).
|
|
@ -82,7 +82,9 @@ def discover_interpreter(action, interpreter_name, discovery_mode, task_vars):
|
||||||
display.debug(u"found interpreters: {0}".format(found_interpreters), host=host)
|
display.debug(u"found interpreters: {0}".format(found_interpreters), host=host)
|
||||||
|
|
||||||
if not found_interpreters:
|
if not found_interpreters:
|
||||||
action._discovery_warnings.append(u'No python interpreters found for host {0} (tried {1})'.format(host, bootstrap_python_list))
|
if not is_silent:
|
||||||
|
action._discovery_warnings.append(u'No python interpreters found for '
|
||||||
|
u'host {0} (tried {1})'.format(host, bootstrap_python_list))
|
||||||
# this is lame, but returning None or throwing an exception is uglier
|
# this is lame, but returning None or throwing an exception is uglier
|
||||||
return u'/usr/bin/python'
|
return u'/usr/bin/python'
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue