From fdbb863af6417dd9630724fc80071baee6560aeb Mon Sep 17 00:00:00 2001 From: Gabriel Cocenza Date: Tue, 23 Apr 2024 15:53:12 -0300 Subject: [PATCH] Move log error to COUException --- cou/cli.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/cou/cli.py b/cou/cli.py index 4f1d2588..c0b08c19 100644 --- a/cou/cli.py +++ b/cou/cli.py @@ -205,7 +205,6 @@ async def _run_command(args: CLIargs) -> None: def entrypoint() -> None: """Execute 'charmed-openstack-upgrade' command.""" - completed_successfully = False try: args = parse_args(sys.argv[1:]) @@ -226,6 +225,10 @@ def entrypoint() -> None: except COUException as exc: progress_indicator.fail() logger.error(exc) + logger.error( + "See the known issues at https://canonical-charmed-openstack-upgrader.readthedocs-" + "hosted.com/en/stable/reference/known-issues/" + ) sys.exit(1) except JujuError as exc: progress_indicator.fail() @@ -242,12 +245,5 @@ def entrypoint() -> None: logger.error("Unexpected error occurred.") logger.exception(exc) sys.exit(2) - else: - completed_successfully = True finally: - if not completed_successfully: - logger.error( - "See the known issues at https://canonical-charmed-openstack-upgrader.readthedocs-" - "hosted.com/en/stable/reference/known-issues/" - ) progress_indicator.stop()