Skip to content

Conversation

@felixfontein
Copy link
Collaborator

SUMMARY

Use raise ... from ... in plugins.

ISSUE TYPE
  • Feature Pull Request
  • Refactoring Pull Request
COMPONENT NAME

various plugins

@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-12 Automatically create a backport for the stable-12 branch labels Nov 11, 2025
@ansibullbot ansibullbot added WIP Work in progress action action plugin cache cache plugin cloud connection connection plugin feature This issue/PR relates to a feature request filter filter plugin inventory inventory plugin lookup lookup plugin plugins plugin (any type) tests tests unit tests/unit labels Nov 11, 2025
@felixfontein felixfontein marked this pull request as ready for review November 11, 2025 05:14
@ansibullbot ansibullbot removed the WIP Work in progress label Nov 11, 2025
@ansibullbot ansibullbot added the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR label Nov 11, 2025
@felixfontein felixfontein requested a review from russoz November 11, 2025 05:52
@ansibullbot ansibullbot removed the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR label Nov 11, 2025
Copy link
Collaborator

@russoz russoz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly not for this PR

parser.read_file(StringIO(obj))
except Exception as ex:
raise AnsibleFilterError(f"from_ini failed to parse given string: {ex}", orig_exc=ex)
raise AnsibleFilterError(f"from_ini failed to parse given string: {ex}", orig_exc=ex) from ex
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not investigated the code for that exception but made we could get rid of:

Suggested change
raise AnsibleFilterError(f"from_ini failed to parse given string: {ex}", orig_exc=ex) from ex
raise AnsibleFilterError(f"from_ini failed to parse given string: {ex}") from ex

(possibly in other locations as well)

@felixfontein felixfontein merged commit 2b4333a into ansible-collections:main Nov 12, 2025
134 checks passed
@felixfontein felixfontein deleted the raise-from branch November 12, 2025 19:34
@patchback
Copy link

patchback bot commented Nov 12, 2025

Backport to stable-12: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-12/2b4333a033c9669737ad76fde0b464601f9a212a/pr-11095

Backported as #11129

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@felixfontein
Copy link
Collaborator Author

@russoz thanks for reviewing!

patchback bot pushed a commit that referenced this pull request Nov 12, 2025
* Use raise from.

* Add changelog fragment.

(cherry picked from commit 2b4333a)
@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Nov 12, 2025
felixfontein added a commit that referenced this pull request Nov 12, 2025
…11129)

Use raise from in plugins (#11095)

* Use raise from.

* Add changelog fragment.

(cherry picked from commit 2b4333a)

Co-authored-by: Felix Fontein <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action action plugin backport-12 Automatically create a backport for the stable-12 branch cache cache plugin cloud connection connection plugin feature This issue/PR relates to a feature request filter filter plugin inventory inventory plugin lookup lookup plugin plugins plugin (any type) tests tests unit tests/unit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants