mirror of
https://github.com/ansible/awx.git
synced 2026-01-18 21:21:21 -03:30
Support passing the schedule when signaling start so we record which
schedule this came from
This commit is contained in:
parent
3adefc685f
commit
b665345070
@ -676,13 +676,13 @@ class InventorySource(UnifiedJobTemplate, InventorySourceOptions):
|
||||
inventory_update_sig = inventory_update.start_signature()
|
||||
return (inventory_update, inventory_update_sig)
|
||||
|
||||
def update(self, **kwargs):
|
||||
def update(self, schedule=None, **kwargs):
|
||||
if self.can_update:
|
||||
inventory_update = self.create_inventory_update()
|
||||
if hasattr(settings, 'CELERY_UNIT_TEST'):
|
||||
inventory_update.start(None, **kwargs)
|
||||
else:
|
||||
inventory_update.signal_start(**kwargs)
|
||||
inventory_update.signal_start(schedule=schedule, **kwargs)
|
||||
return inventory_update
|
||||
|
||||
|
||||
@ -736,8 +736,11 @@ class InventoryUpdate(UnifiedJob, InventorySourceOptions):
|
||||
def task_impact(self):
|
||||
return 50
|
||||
|
||||
def signal_start(self, **kwargs):
|
||||
def signal_start(self, schedule=None, **kwargs):
|
||||
from awx.main.tasks import notify_task_runner
|
||||
if schedule:
|
||||
self.schedule=schedule
|
||||
self.save()
|
||||
if not self.can_start:
|
||||
return False
|
||||
needed = self._get_passwords_needed_to_start()
|
||||
|
||||
@ -319,8 +319,11 @@ class Job(UnifiedJob, JobOptions):
|
||||
dependencies.append(source.create_inventory_update(launch_type='dependency'))
|
||||
return dependencies
|
||||
|
||||
def signal_start(self, **kwargs):
|
||||
def signal_start(self, schedule=None, **kwargs):
|
||||
from awx.main.tasks import notify_task_runner
|
||||
if schedule:
|
||||
self.schedule = schedule
|
||||
self.save()
|
||||
if hasattr(settings, 'CELERY_UNIT_TEST'):
|
||||
return self.start(None, **kwargs)
|
||||
if not self.can_start:
|
||||
|
||||
@ -312,13 +312,13 @@ class Project(UnifiedJobTemplate, ProjectOptions):
|
||||
project_update_sig = project_update.start_signature()
|
||||
return (project_update, project_update_sig)
|
||||
|
||||
def update(self, **kwargs):
|
||||
def update(self, schedule=None, **kwargs):
|
||||
if self.can_update:
|
||||
project_update = self.create_project_update()
|
||||
if hasattr(settings, 'CELERY_UNIT_TEST'):
|
||||
project_update.start(None, **kwargs)
|
||||
else:
|
||||
project_update.signal_start(**kwargs)
|
||||
project_update.signal_start(schedule=schedule, **kwargs)
|
||||
return project_update
|
||||
|
||||
def get_absolute_url(self):
|
||||
@ -359,8 +359,11 @@ class ProjectUpdate(UnifiedJob, ProjectOptions):
|
||||
def task_impact(self):
|
||||
return 20
|
||||
|
||||
def signal_start(self, **kwargs):
|
||||
def signal_start(self, schedule=None, **kwargs):
|
||||
from awx.main.tasks import notify_task_runner
|
||||
if schedule:
|
||||
self.schedule = schedule
|
||||
self.save()
|
||||
if not self.can_start:
|
||||
return False
|
||||
needed = self._get_passwords_needed_to_start()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user