Skip to content

Commit

Permalink
Printing nicer message when playbook is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
linsomniac committed Jan 11, 2024
1 parent f7e4093 commit 4366145
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions uplaybook/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,13 @@ def cli() -> None:
try:
pb_name = args.playbook
up_context.playbook_name = pb_name
playbook = find_playbook(pb_name)

try:
playbook = find_playbook(pb_name)
except FileNotFoundError as e:
print("ERROR: Unable to locate playbook.")
return

up_context.playbook_directory = playbook.directory.absolute()
full_playbook_path = Path(playbook.playbook_file).absolute()

Expand All @@ -382,7 +388,6 @@ def cli() -> None:
)
except Exit as e:
return_code = e.return_code
pass
except Exception as e:
if args.up_full_traceback or not full_playbook_path:
print(traceback.format_exc())
Expand Down

0 comments on commit 4366145

Please sign in to comment.