-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
Catch the raised exception so we can report failure #42177
Conversation
@cclauss This PR contains |
cc @defionscode |
@cclauss Could you please address this - #42177 (comment) ? Thanks. |
Just like ansible#42072 Avoid the _undefined name_ by catching the raised exception into the variable __e__ so it can be reported on the following line. flake8 testing of https://github.com/ansible/ansible on Python 3.6.3 $ __flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics__ ``` ./lib/ansible/modules/cloud/amazon/iam_policy.py:305:16: F821 undefined name 'e' if e.errno == 2: ^ ./lib/ansible/modules/cloud/misc/rhevm.py:594:24: F821 undefined name 'e' setMsg(str(e)) ^ ./lib/ansible/modules/files/archive.py:391:92: F821 undefined name 'e' module.fail_json(dest=dest, msg='Error deleting some source files: ' + str(e), files=errors) ^ 3 F821 undefined name 'e' 3 ```
@Akasurde Addressed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Just like #42072
Avoid the undefined name by catching the raised exception into the variable e so it can be reported on the following line.
flake8 testing of https://github.com/ansible/ansible on Python 3.6.3
$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
SUMMARY
ISSUE TYPE
COMPONENT NAME
ANSIBLE VERSION
ADDITIONAL INFORMATION