[stable-2.17] ansible-test - Improve unknown env error message (#83677)

(cherry picked from commit 906c969b55)

Co-authored-by: Matt Clay <matt@mystile.com>
pull/83701/head
Abhijeet Kasurde 4 months ago committed by GitHub
parent 03446c7f23
commit 4c9438293a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,2 @@
minor_changes:
- ansible-test - Improve the error message shown when an unknown ``--remote`` or ``--docker`` option is given.

@ -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.""" """A Python version was not specified for a context which is unknown, thus the Python version is unknown."""
def __init__(self, context: str) -> None: 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): class ControllerNotSupportedError(ApplicationError):

Loading…
Cancel
Save