From 6ed4fa9afc5cc2b48be388461c00dd7f952b30f0 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Thu, 7 Nov 2024 16:15:52 -0500 Subject: [PATCH] requteo --- lib/ansible/cli/config.py | 2 +- lib/ansible/constants.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/ansible/cli/config.py b/lib/ansible/cli/config.py index 65bac9385b4..ed8556aeca7 100755 --- a/lib/ansible/cli/config.py +++ b/lib/ansible/cli/config.py @@ -96,7 +96,7 @@ class ConfigCLI(CLI): super(ConfigCLI, self).__init__(args, callback) # we don't want 'dynamic' constants - C.force_preload() + C._force_preload() def init_parser(self): diff --git a/lib/ansible/constants.py b/lib/ansible/constants.py index afa91ba9172..e90ee61f605 100644 --- a/lib/ansible/constants.py +++ b/lib/ansible/constants.py @@ -83,9 +83,9 @@ class _DeprecatedSequenceConstant(Sequence): def __getattr__(config_constant): - ''' Handle dynamicall generating a 'constant' when first requested, + """ Handle dynamicall generating a 'constant' when first requested, otherwise just return it from cached value. - ''' + """ if config_constant not in globals(): try: @@ -267,8 +267,9 @@ MAGIC_VARIABLE_MAPPING = dict( ) -def force_preload(): +def _force_preload(): """ read all available constants, used for config dumps """ + # NOTE: previous templating dependencies should already be covered, order does not matter anymore for setting in config.get_configuration_definitions(): set_constant(setting, config.get_config_value(setting, variables=vars()))