mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Make error messages tell which inventory script the error came from
This commit is contained in:
parent
a87687dccb
commit
96836412aa
1 changed files with 2 additions and 2 deletions
|
@ -68,11 +68,11 @@ class InventoryScript:
|
|||
self.raw = self._loader.load(self.data)
|
||||
except Exception as e:
|
||||
sys.stderr.write(err + "\n")
|
||||
raise AnsibleError("failed to parse executable inventory script results: %s" % str(e))
|
||||
raise AnsibleError("failed to parse executable inventory script results from {0}: {1}".format(self.filename, str(e)))
|
||||
|
||||
if not isinstance(self.raw, Mapping):
|
||||
sys.stderr.write(err + "\n")
|
||||
raise AnsibleError("failed to parse executable inventory script results: data needs to be formatted as a json dict" )
|
||||
raise AnsibleError("failed to parse executable inventory script results from {0}: data needs to be formatted as a json dict".format(self.filename))
|
||||
|
||||
self.raw = json_dict_bytes_to_unicode(self.raw)
|
||||
|
||||
|
|
Loading…
Reference in a new issue