From 96836412aa2257a45730e6e133bc479040eb7d71 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Wed, 3 Jun 2015 11:51:05 -0700 Subject: [PATCH] Make error messages tell which inventory script the error came from --- lib/ansible/inventory/script.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/inventory/script.py b/lib/ansible/inventory/script.py index be97f5454c..91549d78fb 100644 --- a/lib/ansible/inventory/script.py +++ b/lib/ansible/inventory/script.py @@ -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)