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
Fix redundant yaml error blurbs on ModArgs parse errors #36923
Merged
bcoca
merged 2 commits into
ansible:devel
from
alikins:fix_double_parser_error_task_36848
Mar 19, 2018
Merged
Fix redundant yaml error blurbs on ModArgs parse errors #36923
bcoca
merged 2 commits into
ansible:devel
from
alikins:fix_double_parser_error_task_36848
Mar 19, 2018
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some of the AnsibleParserErrors from parsing.mod_args are created with the obj=some_yaml_ds options but some are not. If they were, we don't want to add another yaml_ds to it, because that will result in double yaml error blurbs. And since we dont need to add info, we can just re raise it. But if there is no ._obj, add it here so we get the extra detail in the error message (see issue #14790) and raise a new AnsibleParserError instance. Fixes #36848
ansibot
added
bug
This issue/PR relates to a bug.
needs_triage
Needs a first human triage before being processed.
support:core
This issue/PR relates to code supported by the Ansible Engineering Team.
test
This PR relates to tests.
labels
Mar 1, 2018
The test
|
ansibot
added
the
needs_revision
This PR fails CI tests or a maintainer has requested a review/revision of the PR.
label
Mar 1, 2018
ansibot
removed
the
needs_revision
This PR fails CI tests or a maintainer has requested a review/revision of the PR.
label
Mar 1, 2018
mkrizek
removed
the
needs_triage
Needs a first human triage before being processed.
label
Mar 2, 2018
ansibot
added
the
stale_ci
This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested.
label
Mar 10, 2018
abadger
reviewed
Mar 19, 2018
# so we dont need to add it so we can just re raise. | ||
if e._obj: | ||
raise | ||
# But if it wasn't, we can add the yaml object now to get more detail | ||
raise AnsibleParserError(to_native(e), obj=ds, orig_exc=e) |
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.
Is there a difference between obj
and _obj
?
I like what you're doing here. If my question has an answer that you've already considered, then +1 to merge from me. |
cherry-picked to stable-2.5 for 2.5.1 |
nitzmahone
pushed a commit
that referenced
this pull request
Mar 29, 2018
* Fix redundant yaml error blurbs on ModArgs parse errors Some of the AnsibleParserErrors from parsing.mod_args are created with the obj=some_yaml_ds options but some are not. If they were, we don't want to add another yaml_ds to it, because that will result in double yaml error blurbs. And since we dont need to add info, we can just re raise it. But if there is no ._obj, add it here so we get the extra detail in the error message (see issue #14790) and raise a new AnsibleParserError instance. Fixes #36848 * cleanup existing test_tasks pep8/sanity issues (cherry picked from commit e166946)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
bug
This issue/PR relates to a bug.
stale_ci
This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested.
support:core
This issue/PR relates to code supported by the Ansible Engineering Team.
test
This PR relates to tests.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some of the AnsibleParserErrors from parsing.mod_args
are created with the obj=some_yaml_ds options but
some are not.
If they were, we don't want to add another yaml_ds to
it, because that will result in double yaml error blurbs.
And since we dont need to add info, we can just re raise it.
But if there is no ._obj, add it here so we get the extra
detail in the error message (see issue #14790) and raise
a new AnsibleParserError instance.
Fixes #36848
SUMMARY
ISSUE TYPE
COMPONENT NAME
lib/ansible/playbook/task.py
ANSIBLE VERSION