diff options
author | Ryan Petrello <rpetrell@redhat.com> | 2017-11-02 16:35:20 +0100 |
---|---|---|
committer | Ryan Petrello <rpetrell@redhat.com> | 2017-11-14 18:49:12 +0100 |
commit | 28ce9b700e568f524ad0cbac403e90844b3d7b05 (patch) | |
tree | ecdc1cbe1799feb0d562695d2114c0a008b77eb9 /tools/data_generators | |
parent | Merge pull request #637 from ryanpetrello/fix-django-settings-bug (diff) | |
download | awx-28ce9b700e568f524ad0cbac403e90844b3d7b05.tar.xz awx-28ce9b700e568f524ad0cbac403e90844b3d7b05.zip |
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
Diffstat (limited to 'tools/data_generators')
-rwxr-xr-x | tools/data_generators/rbac_dummy_data_generator.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/tools/data_generators/rbac_dummy_data_generator.py b/tools/data_generators/rbac_dummy_data_generator.py index c752dee264..5467b1cbb9 100755 --- a/tools/data_generators/rbac_dummy_data_generator.py +++ b/tools/data_generators/rbac_dummy_data_generator.py @@ -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 |