mirror of
https://github.com/ansible/awx.git
synced 2026-05-16 05:47:38 -02:30
beautify code
This commit is contained in:
@@ -773,7 +773,6 @@ class BaseTask(Task):
|
|||||||
self.final_run_hook(instance, status, **kwargs)
|
self.final_run_hook(instance, status, **kwargs)
|
||||||
instance.websocket_emit_status(status)
|
instance.websocket_emit_status(status)
|
||||||
if status != 'successful' and not hasattr(settings, 'CELERY_UNIT_TEST'):
|
if status != 'successful' and not hasattr(settings, 'CELERY_UNIT_TEST'):
|
||||||
print("Status is not successful!")
|
|
||||||
# Raising an exception will mark the job as 'failed' in celery
|
# Raising an exception will mark the job as 'failed' in celery
|
||||||
# and will stop a task chain from continuing to execute
|
# and will stop a task chain from continuing to execute
|
||||||
if status == 'canceled':
|
if status == 'canceled':
|
||||||
@@ -1858,7 +1857,6 @@ class RunInventoryUpdate(BaseTask):
|
|||||||
raise
|
raise
|
||||||
|
|
||||||
def final_run_hook(self, instance, status, **kwargs):
|
def final_run_hook(self, instance, status, **kwargs):
|
||||||
print("In final run hook")
|
|
||||||
if self.custom_dir_path:
|
if self.custom_dir_path:
|
||||||
for p in self.custom_dir_path:
|
for p in self.custom_dir_path:
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ def test_start_job_fact_cache(hosts, job, inventory, mocker):
|
|||||||
|
|
||||||
job.start_job_fact_cache()
|
job.start_job_fact_cache()
|
||||||
|
|
||||||
job._get_memcache_connection().set.assert_any_call('{}'.format(5), [h.name for h in hosts])
|
job._get_memcache_connection().set.assert_any_call('5', [h.name for h in hosts])
|
||||||
for host in hosts:
|
for host in hosts:
|
||||||
job._get_memcache_connection().set.assert_any_call('{}-{}'.format(5, host.name), json.dumps(host.ansible_facts))
|
job._get_memcache_connection().set.assert_any_call('{}-{}'.format(5, host.name), json.dumps(host.ansible_facts))
|
||||||
job._get_memcache_connection().set.assert_any_call('{}-{}-modified'.format(5, host.name), host.ansible_facts_modified.isoformat())
|
job._get_memcache_connection().set.assert_any_call('{}-{}-modified'.format(5, host.name), host.ansible_facts_modified.isoformat())
|
||||||
|
|||||||
Reference in New Issue
Block a user