Convert vmbuilder to use new Celery step structure

This commit is contained in:
2023-11-16 16:05:55 -05:00
parent e92ed245d6
commit f50f170d4e
2 changed files with 214 additions and 157 deletions

View File

@ -41,11 +41,17 @@ def start(celery, msg, current=0, total=1):
sleep(1)
def fail(celery, msg, current=1, total=1):
def fail(celery, msg, exception=None, current=1, total=1):
if exception is None:
exception = TaskFailure
msg = f"{exception}: {msg}"
logger = getLogger(__name__)
logger.error(msg)
sys.tracebacklimit = 0
raise TaskFailure(msg)
raise exception(msg)
def log_info(celery, msg):