Commit bd9bdb5e authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Fixed import hiding through local var in stop upload cli command. [skip ci]

parent efa3a088
Pipeline #53748 skipped
......@@ -262,33 +262,33 @@ def stop(ctx, uploads, calcs: bool, kill: bool):
logger = utils.get_logger(__name__)
def stop_all(query):
for proc in query:
logger_kwargs = dict(upload_id=proc.upload_id)
if isinstance(proc, proc.Calc):
for process in query:
logger_kwargs = dict(upload_id=process.upload_id)
if isinstance(process, proc.Calc):
'send terminate celery task', celery_task_id=proc.celery_task_id,
'send terminate celery task', celery_task_id=process.celery_task_id,
kill=kill, **logger_kwargs)
kwargs = {}
if kill:
try:, terminate=True, **kwargs), terminate=True, **kwargs)
except Exception as e:
'could not revoke celery task', exc_info=e,
celery_task_id=proc.celery_task_id, **logger_kwargs)
celery_task_id=process.celery_task_id, **logger_kwargs)
if kill:
'fail proc', celery_task_id=proc.celery_task_id, kill=kill,
'fail proc', celery_task_id=process.celery_task_id, kill=kill,
**logger_kwargs)'process terminate via nomad cli')
proc.process_status = proc.PROCESS_COMPLETED
proc.on_process_complete(None)'process terminate via nomad cli')
process.process_status = proc.PROCESS_COMPLETED
if not calcs:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment