From b1012d8e01596d60272268675cc3af5f4c724691 Mon Sep 17 00:00:00 2001 From: Qubasa Date: Tue, 10 Dec 2024 21:12:27 +0100 Subject: [PATCH] clan-cli: Fix incorrect throw on clan update --- pkgs/clan-cli/clan_cli/async_run.py | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/pkgs/clan-cli/clan_cli/async_run.py b/pkgs/clan-cli/clan_cli/async_run.py index 59d9f0837..1a31668ff 100644 --- a/pkgs/clan-cli/clan_cli/async_run.py +++ b/pkgs/clan-cli/clan_cli/async_run.py @@ -252,17 +252,19 @@ class AsyncRuntime: if task.finished and task.async_opts.check: assert task.result is not None error = task.result.error - if log.isEnabledFor(logging.DEBUG): - log.error( - f"failed with error: {error}", - extra={"command_prefix": name}, - exc_info=error, - ) - else: - log.error( - f"failed with error: {error}", extra={"command_prefix": name} - ) - err_count += 1 + if error is not None: + if log.isEnabledFor(logging.DEBUG): + log.error( + f"failed with error: {error}", + extra={"command_prefix": name}, + exc_info=error, + ) + else: + log.error( + f"failed with error: {error}", + extra={"command_prefix": name}, + ) + err_count += 1 if err_count > 0: msg = f"{err_count} hosts failed with an error. Check the logs above"