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

Handle exception raised in recursive_finder API #49590

Open
wants to merge 2 commits into
base: devel
from

Conversation

Projects
None yet
4 participants
@Akasurde
Member

Akasurde commented Dec 6, 2018

SUMMARY

User module can contain Identation errors or syntax errors.
Handle AST exceptions rather than showing traceback while importing such module.

Fixes: #21707

Signed-off-by: Abhijeet Kasurde akasurde@redhat.com

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

lib/ansible/executor/module_common.py
test/units/executor/module_common/test_recursive_finder.py

@abadger

This comment has been minimized.

Member

abadger commented Dec 11, 2018

This doesn't seem like a good idea in this form. Perhaps restricting the exception type to SyntaxError and changing the exception message to say that we were unable to use the module as it is invalid python code?

@samdoran samdoran removed the needs_triage label Dec 11, 2018

@abadger

This comment has been minimized.

Member

abadger commented Dec 11, 2018

needs_revision

Akasurde added some commits Dec 6, 2018

Handle exception raised in recursive_finder API
User module can contain Identation errors or syntax errors.
Handle AST exceptions rather than showing traceback while importing such module.

Fixes: #21707

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Review comment
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

@Akasurde Akasurde force-pushed the Akasurde:i21707 branch from ecf66fa to b73fdae Dec 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment