mirror of
https://github.com/ansible/awx.git
synced 2026-11-22 00:06:10 -03:30
add field to JT for asking to skip tags
This commit is contained in:
+2
-2
@@ -981,8 +981,8 @@ class JobTemplateAccess(BaseAccess):
|
||||
field_whitelist = [
|
||||
'name', 'description', 'forks', 'limit', 'verbosity', 'extra_vars',
|
||||
'job_tags', 'force_handlers', 'skip_tags', 'ask_variables_on_launch',
|
||||
'ask_tags_on_launch', 'ask_job_type_on_launch', 'ask_inventory_on_launch',
|
||||
'ask_credential_on_launch', 'survey_enabled',
|
||||
'ask_tags_on_launch', 'ask_job_type_on_launch', 'ask_skip_tags_on_launch',
|
||||
'ask_inventory_on_launch', 'ask_credential_on_launch', 'survey_enabled',
|
||||
|
||||
# These fields are ignored, but it is convenient for QA to allow clients to post them
|
||||
'last_job_run', 'created', 'modified',
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
import awx.main.fields
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('main', '0026_v300_credential_unique'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='jobtemplate',
|
||||
name='ask_skip_tags_on_launch',
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='credential',
|
||||
name='read_role',
|
||||
field=awx.main.fields.ImplicitRoleField(related_name='+', parent_role=[b'singleton:system_auditor', b'organization.auditor_role', b'use_role', b'admin_role'], to='main.Role', null=b'True'),
|
||||
),
|
||||
]
|
||||
+11
-1
@@ -199,6 +199,10 @@ class JobTemplate(UnifiedJobTemplate, JobOptions, ResourceMixin):
|
||||
blank=True,
|
||||
default=False,
|
||||
)
|
||||
ask_skip_tags_on_launch = models.BooleanField(
|
||||
blank=True,
|
||||
default=False,
|
||||
)
|
||||
ask_job_type_on_launch = models.BooleanField(
|
||||
blank=True,
|
||||
default=False,
|
||||
@@ -418,7 +422,7 @@ class JobTemplate(UnifiedJobTemplate, JobOptions, ResourceMixin):
|
||||
extra_vars=self.ask_variables_on_launch,
|
||||
limit=self.ask_limit_on_launch,
|
||||
job_tags=self.ask_tags_on_launch,
|
||||
skip_tags=self.ask_tags_on_launch,
|
||||
skip_tags=self.ask_skip_tags_on_launch,
|
||||
job_type=self.ask_job_type_on_launch,
|
||||
inventory=self.ask_inventory_on_launch,
|
||||
credential=self.ask_credential_on_launch
|
||||
@@ -550,6 +554,12 @@ class Job(UnifiedJob, JobOptions):
|
||||
return self.job_template.ask_tags_on_launch
|
||||
return False
|
||||
|
||||
@property
|
||||
def ask_skip_tags_on_launch(self):
|
||||
if self.job_template is not None:
|
||||
return self.job_template.ask_skip_tags_on_launch
|
||||
return False
|
||||
|
||||
@property
|
||||
def ask_job_type_on_launch(self):
|
||||
if self.job_template is not None:
|
||||
|
||||
@@ -37,6 +37,7 @@ def job_template_prompts(project, inventory, machine_credential):
|
||||
name='deploy-job-template',
|
||||
ask_variables_on_launch=on_off,
|
||||
ask_tags_on_launch=on_off,
|
||||
ask_skip_tags_on_launch=on_off,
|
||||
ask_job_type_on_launch=on_off,
|
||||
ask_inventory_on_launch=on_off,
|
||||
ask_limit_on_launch=on_off,
|
||||
@@ -54,6 +55,7 @@ def job_template_prompts_null(project):
|
||||
name='deploy-job-template',
|
||||
ask_variables_on_launch=True,
|
||||
ask_tags_on_launch=True,
|
||||
ask_skip_tags_on_launch=True,
|
||||
ask_job_type_on_launch=True,
|
||||
ask_inventory_on_launch=True,
|
||||
ask_limit_on_launch=True,
|
||||
|
||||
@@ -103,9 +103,10 @@ def test_edit_nonsenstive(patch, job_template_factory, alice):
|
||||
'extra_vars': '--',
|
||||
'job_tags': 'sometags',
|
||||
'force_handlers': True,
|
||||
'skip_tags': True,
|
||||
'skip_tags': 'thistag,thattag',
|
||||
'ask_variables_on_launch':True,
|
||||
'ask_tags_on_launch':True,
|
||||
'ask_skip_tags_on_launch':True,
|
||||
'ask_job_type_on_launch':True,
|
||||
'ask_inventory_on_launch':True,
|
||||
'ask_credential_on_launch': True,
|
||||
|
||||
Reference in New Issue
Block a user