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