From 8b8c29b9dcc7b0bd3ce700174a4d1bd3744fdcb0 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Mon, 12 Dec 2016 12:32:49 -0500 Subject: [PATCH] Purge has_schedules Also... migration for big field docs updates --- awx/api/serializers.py | 2 +- .../migrations/0054_text_and_has_schedules.py | 133 ++++++++++++++++++ awx/main/models/unified_jobs.py | 4 - 3 files changed, 134 insertions(+), 5 deletions(-) create mode 100644 awx/main/migrations/0054_text_and_has_schedules.py diff --git a/awx/api/serializers.py b/awx/api/serializers.py index b5a5b326ef..11d3c10234 100644 --- a/awx/api/serializers.py +++ b/awx/api/serializers.py @@ -519,7 +519,7 @@ class UnifiedJobTemplateSerializer(BaseSerializer): class Meta: model = UnifiedJobTemplate - fields = ('*', 'last_job_run', 'last_job_failed', 'has_schedules', + fields = ('*', 'last_job_run', 'last_job_failed', 'next_job_run', 'status') def get_related(self, obj): diff --git a/awx/main/migrations/0054_text_and_has_schedules.py b/awx/main/migrations/0054_text_and_has_schedules.py new file mode 100644 index 0000000000..426e40f211 --- /dev/null +++ b/awx/main/migrations/0054_text_and_has_schedules.py @@ -0,0 +1,133 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('main', '0053_v310_update_timeout_field_type'), + ] + + operations = [ + migrations.RemoveField( + model_name='unifiedjobtemplate', + name='has_schedules', + ), + migrations.AlterField( + model_name='host', + name='instance_id', + field=models.CharField(default=b'', help_text='The value used by the remote inventory source to uniquely identify the host', max_length=1024, blank=True), + ), + migrations.AlterField( + model_name='project', + name='scm_clean', + field=models.BooleanField(default=False, help_text='Discard any local changes before syncing the project.'), + ), + migrations.AlterField( + model_name='project', + name='scm_delete_on_update', + field=models.BooleanField(default=False, help_text='Delete the project before syncing.'), + ), + migrations.AlterField( + model_name='project', + name='scm_type', + field=models.CharField(default=b'', choices=[(b'', 'Manual'), (b'git', 'Git'), (b'hg', 'Mercurial'), (b'svn', 'Subversion')], max_length=8, blank=True, help_text='Specifies the source control system used to store the project.', verbose_name='SCM Type'), + ), + migrations.AlterField( + model_name='project', + name='scm_update_cache_timeout', + field=models.PositiveIntegerField(default=0, help_text='The number of seconds after the last project update ran that a newproject update will be launched as a job dependency.', blank=True), + ), + migrations.AlterField( + model_name='project', + name='scm_update_on_launch', + field=models.BooleanField(default=False, help_text='Update the project when a job is launched that uses the project.'), + ), + migrations.AlterField( + model_name='project', + name='scm_url', + field=models.CharField(default=b'', help_text='The location where the project is stored.', max_length=1024, verbose_name='SCM URL', blank=True), + ), + migrations.AlterField( + model_name='project', + name='timeout', + field=models.IntegerField(default=0, help_text='The amount of time to run before the task is canceled.', blank=True), + ), + migrations.AlterField( + model_name='projectupdate', + name='scm_clean', + field=models.BooleanField(default=False, help_text='Discard any local changes before syncing the project.'), + ), + migrations.AlterField( + model_name='projectupdate', + name='scm_delete_on_update', + field=models.BooleanField(default=False, help_text='Delete the project before syncing.'), + ), + migrations.AlterField( + model_name='projectupdate', + name='scm_type', + field=models.CharField(default=b'', choices=[(b'', 'Manual'), (b'git', 'Git'), (b'hg', 'Mercurial'), (b'svn', 'Subversion')], max_length=8, blank=True, help_text='Specifies the source control system used to store the project.', verbose_name='SCM Type'), + ), + migrations.AlterField( + model_name='projectupdate', + name='scm_url', + field=models.CharField(default=b'', help_text='The location where the project is stored.', max_length=1024, verbose_name='SCM URL', blank=True), + ), + migrations.AlterField( + model_name='projectupdate', + name='timeout', + field=models.IntegerField(default=0, help_text='The amount of time to run before the task is canceled.', blank=True), + ), + migrations.AlterField( + model_name='schedule', + name='dtend', + field=models.DateTimeField(default=None, help_text='The last occurrence of the schedule occurs before this time, aftewards the schedule expires.', null=True, editable=False), + ), + migrations.AlterField( + model_name='schedule', + name='dtstart', + field=models.DateTimeField(default=None, help_text='The first occurrence of the schedule occurs on or after this time.', null=True, editable=False), + ), + migrations.AlterField( + model_name='schedule', + name='enabled', + field=models.BooleanField(default=True, help_text='Enables processing of this schedule by Tower.'), + ), + migrations.AlterField( + model_name='schedule', + name='next_run', + field=models.DateTimeField(default=None, help_text='The next time that the scheduled action will run.', null=True, editable=False), + ), + migrations.AlterField( + model_name='schedule', + name='rrule', + field=models.CharField(help_text='A value representing the schedules iCal recurrence rule.', max_length=255), + ), + migrations.AlterField( + model_name='unifiedjob', + name='elapsed', + field=models.DecimalField(help_text='Elapsed time in seconds that the job ran.', editable=False, max_digits=12, decimal_places=3), + ), + migrations.AlterField( + model_name='unifiedjob', + name='execution_node', + field=models.TextField(default=b'', help_text='The Tower node the job executed on.', editable=False, blank=True), + ), + migrations.AlterField( + model_name='unifiedjob', + name='finished', + field=models.DateTimeField(default=None, help_text='The date and time the job finished execution.', null=True, editable=False), + ), + migrations.AlterField( + model_name='unifiedjob', + name='job_explanation', + field=models.TextField(default=b'', help_text="A status field to indicate the state of the job if it wasn't able to run and capture stdout", editable=False, blank=True), + ), + migrations.AlterField( + model_name='unifiedjob', + name='started', + field=models.DateTimeField(default=None, help_text='The date and time the job was queued for starting.', null=True, editable=False), + ), + ] diff --git a/awx/main/models/unified_jobs.py b/awx/main/models/unified_jobs.py index 1a340345ea..bda60b0c1d 100644 --- a/awx/main/models/unified_jobs.py +++ b/awx/main/models/unified_jobs.py @@ -122,10 +122,6 @@ class UnifiedJobTemplate(PolymorphicModel, CommonModelNameNotUnique, Notificatio default=None, editable=False, ) - has_schedules = models.BooleanField( - default=False, - editable=False, - ) #on_missed_schedule = models.CharField( # max_length=32, # choices=[],