mirror of
https://github.com/ansible/awx.git
synced 2026-02-02 18:18:12 -03:30
replace all Job/JT relations with a single M2M credentials relation
Includes backwards compatibility for now-deprecated .credential, .vault_credential, and .extra_credentials This is a building block for multi-vault implementation and Alan's saved launch configurations (both coming soon) see: https://github.com/ansible/awx/issues/352 see: https://github.com/ansible/awx/issues/169
This commit is contained in:
@@ -490,16 +490,16 @@ def make_the_data():
|
||||
defaults=dict(
|
||||
inventory=inventory,
|
||||
project=project,
|
||||
credential=next(credential_gen),
|
||||
created_by=next(creator_gen),
|
||||
modified_by=next(modifier_gen),
|
||||
playbook="debug.yml",
|
||||
**extra_kwargs)
|
||||
)
|
||||
job_template.credentials.add(next(credential_gen))
|
||||
if ids['job_template'] % 7 == 0:
|
||||
job_template.extra_credentials.add(next(credential_gen))
|
||||
job_template.credentials.add(next(credential_gen))
|
||||
if ids['job_template'] % 5 == 0: # formerly cloud credential
|
||||
job_template.extra_credentials.add(next(credential_gen))
|
||||
job_template.credentials.add(next(credential_gen))
|
||||
job_template._is_new = _
|
||||
job_templates.append(job_template)
|
||||
inv_idx += 1
|
||||
@@ -649,10 +649,9 @@ def make_the_data():
|
||||
job_template=job_template,
|
||||
status=job_stat, name="%s-%d" % (job_template.name, job_i),
|
||||
project=job_template.project, inventory=job_template.inventory,
|
||||
credential=job_template.credential,
|
||||
)
|
||||
for ec in job_template.extra_credentials.all():
|
||||
job.extra_credentials.add(ec)
|
||||
for ec in job_template.credentials.all():
|
||||
job.credentials.add(ec)
|
||||
job._is_new = _
|
||||
jobs.append(job)
|
||||
job_i += 1
|
||||
|
||||
Reference in New Issue
Block a user