summaryrefslogtreecommitdiff
path: root/lib/ansible/errors
diff options
context:
space:
mode:
authorJames Cammarata <jimi@sngx.net>2016-01-25 13:04:52 -0500
committerJames Cammarata <jimi@sngx.net>2016-03-24 10:12:51 -0400
commit2c20579a06925a16abb95798237b97ce4987173d (patch)
treece365a357b8172bbc43f785507e6ee78c0212567 /lib/ansible/errors
parentf323eb858e543a4f51f15f0b3090925fbef1cefb (diff)
downloadansible-2c20579a06925a16abb95798237b97ce4987173d.tar.gz
Add options to make includes 'static'
* Can be configured in the ansible.cfg for tasks/handlers individually * If an included filename contains no vars or loops, it will be expanded in-place as if it were marked as static
Diffstat (limited to 'lib/ansible/errors')
-rw-r--r--lib/ansible/errors/__init__.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/ansible/errors/__init__.py b/lib/ansible/errors/__init__.py
index faf7c33416..78259000aa 100644
--- a/lib/ansible/errors/__init__.py
+++ b/lib/ansible/errors/__init__.py
@@ -44,7 +44,7 @@ class AnsibleError(Exception):
which should be returned by the DataLoader() class.
'''
- def __init__(self, message="", obj=None, show_content=True):
+ def __init__(self, message="", obj=None, show_content=True, suppress_extended_error=False):
# we import this here to prevent an import loop problem,
# since the objects code also imports ansible.errors
from ansible.parsing.yaml.objects import AnsibleBaseYAMLObject
@@ -53,8 +53,10 @@ class AnsibleError(Exception):
self._show_content = show_content
if obj and isinstance(obj, AnsibleBaseYAMLObject):
extended_error = self._get_extended_error()
- if extended_error:
+ if extended_error and not suppress_extended_error:
self.message = '%s\n\n%s' % (to_str(message), to_str(extended_error))
+ else:
+ self.message = '%s' % to_str(message)
else:
self.message = '%s' % to_str(message)