mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
[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:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user