From 2f3aafe1bb3c1ca145ecc3c89861cd7886d96ad7 Mon Sep 17 00:00:00 2001 From: AlanCoding Date: Tue, 6 Aug 2019 09:16:51 -0400 Subject: [PATCH] Add collection setting toggle to UI Additional API housekeeping, removing unused code Treat default branch as no branch provided --- awx/main/models/jobs.py | 4 ++++ awx/main/tasks.py | 3 +-- awx/playbooks/project_update.yml | 1 - .../configuration/forms/jobs-form/configuration-jobs.form.js | 3 +++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/awx/main/models/jobs.py b/awx/main/models/jobs.py index b71ed8d957..ceff1c8cb7 100644 --- a/awx/main/models/jobs.py +++ b/awx/main/models/jobs.py @@ -399,6 +399,10 @@ class JobTemplate(UnifiedJobTemplate, JobOptions, SurveyJobTemplateMixin, Resour # no-op case: Fields the same as template's value # counted as neither accepted or ignored continue + elif field_name == 'scm_branch' and old_value == '' and self.project and new_value == self.project.scm_branch: + # special case of "not provided" for branches + # job template does not provide branch, runs with default branch + continue elif getattr(self, ask_field_name): # Special case where prompts can be rejected based on project setting if field_name == 'scm_branch': diff --git a/awx/main/tasks.py b/awx/main/tasks.py index a6d5937361..e8f671ee9e 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -702,8 +702,7 @@ class BaseTask(object): abstract = True proot_show_paths = [] - def __init__(self, *args, **kwargs): - super(BaseTask, self).__init__(*args, **kwargs) + def __init__(self): self.cleanup_paths = [] def update_model(self, pk, _attempt=0, **updates): diff --git a/awx/playbooks/project_update.yml b/awx/playbooks/project_update.yml index 2d03660d5e..51f90e5afc 100644 --- a/awx/playbooks/project_update.yml +++ b/awx/playbooks/project_update.yml @@ -137,7 +137,6 @@ delegate_to: localhost - block: - # TODO: don't run this if ansible verison doens't support collections - name: detect collections/requirements.yml stat: path={{project_path|quote}}/collections/requirements.yml register: doesCollectionRequirementsExist diff --git a/awx/ui/client/src/configuration/forms/jobs-form/configuration-jobs.form.js b/awx/ui/client/src/configuration/forms/jobs-form/configuration-jobs.form.js index 8822f531bd..021e4c4387 100644 --- a/awx/ui/client/src/configuration/forms/jobs-form/configuration-jobs.form.js +++ b/awx/ui/client/src/configuration/forms/jobs-form/configuration-jobs.form.js @@ -61,6 +61,9 @@ export default ['i18n', function(i18n) { AWX_ROLES_ENABLED: { type: 'toggleSwitch', }, + AWX_COLLECTIONS_ENABLED: { + type: 'toggleSwitch', + }, AWX_TASK_ENV: { type: 'textarea', reset: 'AWX_TASK_ENV',