mirror of
https://github.com/ansible/awx.git
synced 2026-02-28 00:08:44 -03:30
Enabled jinja2.ChainableUndefined for custom webhook notifications
Signed-off-by: Will Haines <william.haines@colorado.edu>
This commit is contained in:
@@ -12,7 +12,7 @@ from django.core.mail.message import EmailMessage
|
|||||||
from django.db import connection
|
from django.db import connection
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
from django.utils.encoding import smart_str, force_text
|
from django.utils.encoding import smart_str, force_text
|
||||||
from jinja2 import sandbox
|
from jinja2 import sandbox, ChainableUndefined
|
||||||
from jinja2.exceptions import TemplateSyntaxError, UndefinedError, SecurityError
|
from jinja2.exceptions import TemplateSyntaxError, UndefinedError, SecurityError
|
||||||
|
|
||||||
# AWX
|
# AWX
|
||||||
@@ -429,7 +429,7 @@ class JobNotificationMixin(object):
|
|||||||
raise RuntimeError("Define me")
|
raise RuntimeError("Define me")
|
||||||
|
|
||||||
def build_notification_message(self, nt, status):
|
def build_notification_message(self, nt, status):
|
||||||
env = sandbox.ImmutableSandboxedEnvironment()
|
env = sandbox.ImmutableSandboxedEnvironment(undefined=ChainableUndefined)
|
||||||
|
|
||||||
from awx.api.serializers import UnifiedJobSerializer
|
from awx.api.serializers import UnifiedJobSerializer
|
||||||
job_serialization = UnifiedJobSerializer(self).to_representation(self)
|
job_serialization = UnifiedJobSerializer(self).to_representation(self)
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ azure-mgmt-iothub==0.7.0
|
|||||||
# AWS
|
# AWS
|
||||||
boto==2.47.0 # last which does not break ec2 scripts
|
boto==2.47.0 # last which does not break ec2 scripts
|
||||||
boto3==1.9.223
|
boto3==1.9.223
|
||||||
jinja2==2.10.1 # required for native jinja2 types for inventory compat mode
|
jinja2==2.11.2 # required for ChainableUndefined
|
||||||
# netconf for network modules
|
# netconf for network modules
|
||||||
ncclient==0.6.3
|
ncclient==0.6.3
|
||||||
# netaddr filter
|
# netaddr filter
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ idna==2.8 # via requests
|
|||||||
ipaddress==1.0.23; python_version < "3" # via cryptography, kubernetes, openstacksdk
|
ipaddress==1.0.23; python_version < "3" # via cryptography, kubernetes, openstacksdk
|
||||||
iso8601==0.1.12 # via keystoneauth1, openstacksdk
|
iso8601==0.1.12 # via keystoneauth1, openstacksdk
|
||||||
isodate==0.6.0 # via msrest
|
isodate==0.6.0 # via msrest
|
||||||
jinja2==2.10.1 # via -r /awx_devel/requirements/requirements_ansible.in, openshift
|
jinja2==2.11.2 # via -r /awx_devel/requirements/requirements_ansible.in, openshift
|
||||||
jmespath==0.9.4 # via azure-cli-core, boto3, botocore, knack, openstacksdk
|
jmespath==0.9.4 # via azure-cli-core, boto3, botocore, knack, openstacksdk
|
||||||
jsonpatch==1.24 # via openstacksdk
|
jsonpatch==1.24 # via openstacksdk
|
||||||
jsonpointer==2.0 # via jsonpatch
|
jsonpointer==2.0 # via jsonpatch
|
||||||
|
|||||||
Reference in New Issue
Block a user