From 13a0c1c544174fec5c9d8d8695781b6b2d834304 Mon Sep 17 00:00:00 2001 From: tomerlf1 <125286113+tomerlf1@users.noreply.github.com> Date: Mon, 12 Feb 2024 14:23:54 +0200 Subject: [PATCH] Update gce_rescue/utils.py Co-authored-by: soulless-viewer <29832584+soulless-viewer@users.noreply.github.com> --- gce_rescue/utils.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gce_rescue/utils.py b/gce_rescue/utils.py index a48d537..7d80527 100644 --- a/gce_rescue/utils.py +++ b/gce_rescue/utils.py @@ -151,9 +151,8 @@ def inner(*args, **kwargs): _logger.info('task %s ' 'started at: %s', task_func.__name__, datetime.now().strftime('%H:%M:%S')) - task_index = kwargs.pop('task_index') if kwargs.get('task_index') else None - total_tasks = kwargs.pop('total_tasks') if kwargs.get('total_tasks') \ - else None + task_index = kwargs.pop('task_index', None) + total_tasks = kwargs.pop('total_tasks', None) try: res = task_func(*args, **kwargs) except HttpError as e: