mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 11:20:39 -03:30
Merge pull request #5978 from AlanCoding/hide_ev_notification
Hide extra_vars in job notifications
This commit is contained in:
commit
f0102ef0ff
@ -595,7 +595,7 @@ class Job(UnifiedJob, JobOptions, SurveyJobMixin, JobNotificationMixin):
|
||||
playbook=self.playbook,
|
||||
credential=self.credential.name if self.credential else None,
|
||||
limit=self.limit,
|
||||
extra_vars=self.extra_vars,
|
||||
extra_vars=self.display_extra_vars(),
|
||||
hosts=all_hosts))
|
||||
return data
|
||||
|
||||
|
||||
@ -2,6 +2,8 @@ from awx.main.models import Job, Instance
|
||||
from django.test.utils import override_settings
|
||||
import pytest
|
||||
|
||||
import json
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_orphan_unified_job_creation(instance, inventory):
|
||||
@ -22,3 +24,15 @@ def test_job_capacity_and_with_inactive_node():
|
||||
assert Instance.objects.total_capacity() == 100
|
||||
with override_settings(AWX_ACTIVE_NODE_TIME=0):
|
||||
assert Instance.objects.total_capacity() < 100
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_job_notification_data(inventory):
|
||||
encrypted_str = "$encrypted$"
|
||||
job = Job.objects.create(
|
||||
job_template=None, inventory=inventory, name='hi world',
|
||||
extra_vars=json.dumps({"SSN": "123-45-6789"}),
|
||||
survey_passwords={"SSN": encrypted_str}
|
||||
)
|
||||
notification_data = job.notification_data(block=0)
|
||||
assert json.loads(notification_data['extra_vars'])['SSN'] == encrypted_str
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user