mirror of
https://github.com/ansible/awx.git
synced 2026-08-01 10:29:56 -02:30
add inventory name and id to meta vars
This commit is contained in:
@@ -256,6 +256,7 @@ class TestExtraVarSanitation(TestJobExecution):
|
||||
|
||||
def test_vars_unsafe_by_default(self, job, private_data_dir):
|
||||
job.created_by = User(pk=123, username='angry-spud')
|
||||
job.inventory = Inventory(pk=123, name='example-inv')
|
||||
|
||||
task = tasks.RunJob()
|
||||
task.build_extra_vars_file(job, private_data_dir)
|
||||
@@ -268,13 +269,14 @@ class TestExtraVarSanitation(TestJobExecution):
|
||||
'awx_user_name', 'tower_job_launch_type',
|
||||
'awx_project_revision',
|
||||
'tower_project_revision', 'tower_user_name',
|
||||
'awx_job_launch_type']:
|
||||
'awx_job_launch_type',
|
||||
'awx_inventory_name', 'tower_inventory_name']:
|
||||
assert hasattr(extra_vars[unsafe], '__UNSAFE__')
|
||||
|
||||
# ensure that non-strings are marked as safe
|
||||
for safe in ['awx_job_template_id', 'awx_job_id', 'awx_user_id',
|
||||
'tower_user_id', 'tower_job_template_id',
|
||||
'tower_job_id']:
|
||||
'tower_job_id', 'awx_inventory_id', 'tower_inventory_id']:
|
||||
assert not hasattr(extra_vars[safe], '__UNSAFE__')
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user