From e2489375959d38378312a26f908247ac41ae4706 Mon Sep 17 00:00:00 2001 From: Chris Church Date: Mon, 28 Mar 2016 18:42:03 -0400 Subject: [PATCH] Remove scan as an option for job type on ad hoc commands. --- awx/main/migrations/0001_initial.py | 2 +- awx/main/models/ad_hoc_commands.py | 2 +- awx/main/models/base.py | 7 ++++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/awx/main/migrations/0001_initial.py b/awx/main/migrations/0001_initial.py index 6d2c78e454..bdc98cace2 100644 --- a/awx/main/migrations/0001_initial.py +++ b/awx/main/migrations/0001_initial.py @@ -381,7 +381,7 @@ class Migration(migrations.Migration): name='AdHocCommand', fields=[ ('unifiedjob_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='main.UnifiedJob')), - ('job_type', models.CharField(default=b'run', max_length=64, choices=[(b'run', 'Run'), (b'check', 'Check'), (b'scan', 'Scan')])), + ('job_type', models.CharField(default=b'run', max_length=64, choices=[(b'run', 'Run'), (b'check', 'Check')])), ('limit', models.CharField(default=b'', max_length=1024, blank=True)), ('module_name', models.CharField(default=b'', max_length=1024, blank=True)), ('module_args', models.TextField(default=b'', blank=True)), diff --git a/awx/main/models/ad_hoc_commands.py b/awx/main/models/ad_hoc_commands.py index c5ab627046..e04bd510a1 100644 --- a/awx/main/models/ad_hoc_commands.py +++ b/awx/main/models/ad_hoc_commands.py @@ -36,7 +36,7 @@ class AdHocCommand(UnifiedJob): job_type = models.CharField( max_length=64, - choices=JOB_TYPE_CHOICES, + choices=AD_HOC_JOB_TYPE_CHOICES, default='run', ) inventory = models.ForeignKey( diff --git a/awx/main/models/base.py b/awx/main/models/base.py index b912a71572..c1ddb3600e 100644 --- a/awx/main/models/base.py +++ b/awx/main/models/base.py @@ -29,7 +29,7 @@ __all__ = ['VarsDictProperty', 'BaseModel', 'CreatedModifiedModel', 'PERM_INVENTORY_ADMIN', 'PERM_INVENTORY_READ', 'PERM_INVENTORY_WRITE', 'PERM_INVENTORY_DEPLOY', 'PERM_INVENTORY_SCAN', 'PERM_INVENTORY_CHECK', 'PERM_JOBTEMPLATE_CREATE', 'JOB_TYPE_CHOICES', - 'PERMISSION_TYPE_CHOICES', 'CLOUD_INVENTORY_SOURCES', + 'AD_HOC_JOB_TYPE_CHOICES', 'PERMISSION_TYPE_CHOICES', 'CLOUD_INVENTORY_SOURCES', 'VERBOSITY_CHOICES'] PERM_INVENTORY_ADMIN = 'admin' @@ -46,6 +46,11 @@ JOB_TYPE_CHOICES = [ (PERM_INVENTORY_SCAN, _('Scan')), ] +AD_HOC_JOB_TYPE_CHOICES = [ + (PERM_INVENTORY_DEPLOY, _('Run')), + (PERM_INVENTORY_CHECK, _('Check')), +] + PERMISSION_TYPE_CHOICES = [ (PERM_INVENTORY_READ, _('Read Inventory')), (PERM_INVENTORY_WRITE, _('Edit Inventory')),