ansible-test - No locale warning with delegation. (#78505)

The locale warning for the origin host is not relevant when delegation is used.
It is also not relevant when non-test commands are in use.
pull/78506/head
Matt Clay 2 years ago committed by GitHub
parent 47804fcdf5
commit 8367af9cdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -47,6 +47,10 @@ from .provisioning import (
PrimeContainers,
)
from .config import (
TestConfig,
)
def main(cli_args: t.Optional[list[str]] = None) -> None:
"""Main program function."""
@ -60,7 +64,7 @@ def main(cli_args: t.Optional[list[str]] = None) -> None:
display.color = config.color
display.fd = sys.stderr if config.display_stderr else sys.stdout
configure_timeout(config)
report_locale()
report_locale(isinstance(config, TestConfig) and not config.delegate)
display.info('RLIMIT_NOFILE: %s' % (CURRENT_RLIMIT_NOFILE,), verbosity=2)

@ -657,12 +657,12 @@ def common_environment():
return env
def report_locale() -> None:
def report_locale(show_warning: bool) -> None:
"""Report the configured locale and the locale warning, if applicable."""
display.info(f'Configured locale: {CONFIGURED_LOCALE}', verbosity=1)
if LOCALE_WARNING:
if LOCALE_WARNING and show_warning:
display.warning(LOCALE_WARNING)

Loading…
Cancel
Save