mirror of
https://github.com/ansible/awx.git
synced 2026-05-17 06:17:36 -02:30
Remove timeout fields from sys job & adhoc cmd.
This commit is contained in:
@@ -2062,7 +2062,7 @@ class AdHocCommandSerializer(UnifiedJobSerializer):
|
|||||||
model = AdHocCommand
|
model = AdHocCommand
|
||||||
fields = ('*', 'job_type', 'inventory', 'limit', 'credential',
|
fields = ('*', 'job_type', 'inventory', 'limit', 'credential',
|
||||||
'module_name', 'module_args', 'forks', 'verbosity', 'extra_vars',
|
'module_name', 'module_args', 'forks', 'verbosity', 'extra_vars',
|
||||||
'become_enabled', 'timeout', '-unified_job_template', '-description')
|
'become_enabled', '-unified_job_template', '-description')
|
||||||
extra_kwargs = {
|
extra_kwargs = {
|
||||||
'name': {
|
'name': {
|
||||||
'read_only': True,
|
'read_only': True,
|
||||||
@@ -2160,7 +2160,7 @@ class SystemJobSerializer(UnifiedJobSerializer):
|
|||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = SystemJob
|
model = SystemJob
|
||||||
fields = ('*', 'system_job_template', 'job_type', 'extra_vars', 'timeout')
|
fields = ('*', 'system_job_template', 'job_type', 'extra_vars')
|
||||||
|
|
||||||
def get_related(self, obj):
|
def get_related(self, obj):
|
||||||
res = super(SystemJobSerializer, self).get_related(obj)
|
res = super(SystemJobSerializer, self).get_related(obj)
|
||||||
|
|||||||
@@ -11,11 +11,6 @@ class Migration(migrations.Migration):
|
|||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
migrations.AddField(
|
|
||||||
model_name='adhoccommand',
|
|
||||||
name='timeout',
|
|
||||||
field=models.PositiveIntegerField(default=0, blank=True),
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name='inventorysource',
|
model_name='inventorysource',
|
||||||
name='timeout',
|
name='timeout',
|
||||||
@@ -46,14 +41,4 @@ class Migration(migrations.Migration):
|
|||||||
name='timeout',
|
name='timeout',
|
||||||
field=models.PositiveIntegerField(default=0, blank=True),
|
field=models.PositiveIntegerField(default=0, blank=True),
|
||||||
),
|
),
|
||||||
migrations.AddField(
|
|
||||||
model_name='systemjob',
|
|
||||||
name='timeout',
|
|
||||||
field=models.PositiveIntegerField(default=0, blank=True),
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='systemjobtemplate',
|
|
||||||
name='timeout',
|
|
||||||
field=models.PositiveIntegerField(default=0, blank=True),
|
|
||||||
),
|
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -88,10 +88,6 @@ class AdHocCommand(UnifiedJob, JobNotificationMixin):
|
|||||||
blank=True,
|
blank=True,
|
||||||
default='',
|
default='',
|
||||||
)
|
)
|
||||||
timeout = models.PositiveIntegerField(
|
|
||||||
blank=True,
|
|
||||||
default=0,
|
|
||||||
)
|
|
||||||
|
|
||||||
extra_vars_dict = VarsDictProperty('extra_vars', True)
|
extra_vars_dict = VarsDictProperty('extra_vars', True)
|
||||||
|
|
||||||
|
|||||||
@@ -1336,10 +1336,6 @@ class SystemJobOptions(BaseModel):
|
|||||||
default='',
|
default='',
|
||||||
)
|
)
|
||||||
|
|
||||||
timeout = models.PositiveIntegerField(
|
|
||||||
blank=True,
|
|
||||||
default=0,
|
|
||||||
)
|
|
||||||
|
|
||||||
class SystemJobTemplate(UnifiedJobTemplate, SystemJobOptions):
|
class SystemJobTemplate(UnifiedJobTemplate, SystemJobOptions):
|
||||||
|
|
||||||
@@ -1352,7 +1348,7 @@ class SystemJobTemplate(UnifiedJobTemplate, SystemJobOptions):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _get_unified_job_field_names(cls):
|
def _get_unified_job_field_names(cls):
|
||||||
return ['name', 'description', 'job_type', 'extra_vars', 'timeout']
|
return ['name', 'description', 'job_type', 'extra_vars']
|
||||||
|
|
||||||
def get_absolute_url(self):
|
def get_absolute_url(self):
|
||||||
return reverse('api:system_job_template_detail', args=(self.pk,))
|
return reverse('api:system_job_template_detail', args=(self.pk,))
|
||||||
|
|||||||
@@ -597,9 +597,6 @@ class BaseTask(Task):
|
|||||||
else:
|
else:
|
||||||
os.kill(job.pid, signal.SIGTERM)
|
os.kill(job.pid, signal.SIGTERM)
|
||||||
time.sleep(3)
|
time.sleep(3)
|
||||||
if is_cancel:
|
|
||||||
return True
|
|
||||||
self.timed_out = True
|
|
||||||
except OSError:
|
except OSError:
|
||||||
keyword = 'cancel' if is_cancel else 'timeout'
|
keyword = 'cancel' if is_cancel else 'timeout'
|
||||||
logger.warn("Attempted to %s already finished job, ignoring" % keyword)
|
logger.warn("Attempted to %s already finished job, ignoring" % keyword)
|
||||||
|
|||||||
Reference in New Issue
Block a user