[PR #11095/2b4333a0 backport][stable-12] Use raise from in plugins (#11129)

Use raise from in plugins (#11095)

* Use raise from.

* Add changelog fragment.

(cherry picked from commit 2b4333a033)

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
patchback[bot]
2025-11-12 21:00:39 +01:00
committed by GitHub
parent cddb570e0e
commit cc93dab0fd
46 changed files with 218 additions and 165 deletions

View File

@@ -124,7 +124,9 @@ class InventoryModule(BaseInventoryPlugin, Constructable):
# Create groups based on variable values and add the corresponding hosts to it
self._add_host_to_keyed_groups(self.get_option("keyed_groups"), host_attrs, host, strict=strict)
except Exception as e:
raise AnsibleParserError(f"Unable to fetch hosts from GitLab API, this was the original exception: {e}")
raise AnsibleParserError(
f"Unable to fetch hosts from GitLab API, this was the original exception: {e}"
) from e
def verify_file(self, path):
"""Return the possibly of a file being consumable by this plugin."""