Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't swallow exceptions when processing included files #54791

Merged
merged 3 commits into from
Apr 8, 2019

Conversation

sivel
Copy link
Member

@sivel sivel commented Apr 3, 2019

SUMMARY

Don't swallow exceptions when processing included files. Fixes #54786

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

lib/ansible/plugins/strategy

ADDITIONAL INFORMATION

@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. core_review In order to be merged, this PR must follow the core review workflow. needs_triage Needs a first human triage before being processed. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Apr 3, 2019
@bcoca
Copy link
Member

bcoca commented Apr 3, 2019

not sure that this change is correct, AnsibleError is way too wide a trap, but we probably want to get 'failed to include' errors .. might be worth using specific exception class.

@sivel
Copy link
Member Author

sivel commented Apr 3, 2019

In the above case, it was swallowing AnsibleUndefinedVariable. However there have been other similar cases. I'm not sure I see any other exceptions being raised in that code that are ansible related. We'll catch AnsibleError higher up anyway, so I think it's safe to just let them fly.

@bcoca
Copy link
Member

bcoca commented Apr 3, 2019

in one branch we are doing tqm run errors, which is a specific way of exiting, i would keep that behaviour for 'failing to include/import' .. other errors we still want to let through.

@sivel
Copy link
Member Author

sivel commented Apr 3, 2019

in one branch we are doing tqm run errors, which is a specific way of exiting

It ends up affecting the exit the same way. If we return with self._tqm.RUN_ERROR we get an exit code of 1. If we let the exception fly, we get an exception of 1. It shouldn't affect any current behaviors. But if you can think of a specific exception we should catch there, I'm game for limiting it.

@bcoca bcoca merged commit 56ae8eb into ansible:devel Apr 8, 2019
@bcoca bcoca removed the needs_triage Needs a first human triage before being processed. label Apr 8, 2019
@ansible ansible locked and limited conversation to collaborators Jul 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. core_review In order to be merged, this PR must follow the core review workflow. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

include_role does not complain about undefined variables
4 participants