Use raise from in plugins (#11095)

* Use raise from.

* Add changelog fragment.
This commit is contained in:
Felix Fontein
2025-11-12 20:34:26 +01:00
committed by GitHub
parent 1a82e93c6d
commit 2b4333a033
46 changed files with 218 additions and 165 deletions

View File

@@ -312,7 +312,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
try:
self._vbox_path = get_bin_path(self.VBOX)
except ValueError as e:
raise AnsibleParserError(e)
raise AnsibleParserError(e) from e
super().parse(inventory, loader, path)
@@ -354,7 +354,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
try:
p = Popen(cmd, stdout=PIPE)
except Exception as e:
raise AnsibleParserError(str(e))
raise AnsibleParserError(str(e)) from e
source_data = p.stdout.read().splitlines()