Skip to content

Commit

Permalink
Move log error to COUException
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielcocenza committed Apr 23, 2024
1 parent 26eaa8b commit fdbb863
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions cou/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:])

Expand All @@ -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()
Expand All @@ -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()

0 comments on commit fdbb863

Please sign in to comment.