Skip to content

Commit

Permalink
ansible-test - Improve unknown env error message (ansible#83610)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattclay authored Jul 15, 2024
1 parent 506d12d commit 906c969
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- ansible-test - Improve the error message shown when an unknown ``--remote`` or ``--docker`` option is given.
5 changes: 4 additions & 1 deletion test/lib/ansible_test/_internal/cli/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ class PythonVersionUnspecifiedError(ApplicationError):
"""A Python version was not specified for a context which is unknown, thus the Python version is unknown."""

def __init__(self, context: str) -> None:
super().__init__(f'A Python version was not specified for environment `{context}`. Use the `--python` option to specify a Python version.')
super().__init__(
f'Environment `{context}` is unknown. Use a predefined environment instead. '
f'Alternatively, to use an unknown environment, use the `--python` option to specify a Python version.'
)


class ControllerNotSupportedError(ApplicationError):
Expand Down

0 comments on commit 906c969

Please sign in to comment.