ansible-core 2.19.0rc1__py3-none-any.whl → 2.19.0rc2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of ansible-core might be problematic. Click here for more details.

ansible/config/manager.py CHANGED
@@ -6,6 +6,7 @@ from __future__ import annotations
6
6
  import atexit
7
7
  import decimal
8
8
  import configparser
9
+ import functools
9
10
  import os
10
11
  import os.path
11
12
  import sys
@@ -248,18 +249,6 @@ def get_config_type(cfile):
248
249
  return ftype
249
250
 
250
251
 
251
- # FIXME: can move to module_utils for use for ini plugins also?
252
- def get_ini_config_value(p, entry):
253
- """ returns the value of last ini entry found """
254
- value = None
255
- if p is not None:
256
- try:
257
- value = p.get(entry.get('section', 'defaults'), entry.get('key', ''), raw=True)
258
- except Exception: # FIXME: actually report issues here
259
- pass
260
- return value
261
-
262
-
263
252
  def find_ini_config_file(warnings=None):
264
253
  """ Load INI Config File order(first found is used): ENV, CWD, HOME, /etc/ansible """
265
254
  # FIXME: eventually deprecate ini configs
@@ -345,6 +334,7 @@ class ConfigManager:
345
334
  _errors: list[tuple[str, Exception]]
346
335
 
347
336
  def __init__(self, conf_file=None, defs_file=None):
337
+ self._get_ini_config_value = functools.cache(self._get_ini_config_value)
348
338
 
349
339
  self._base_defs = {}
350
340
  self._plugins = {}
@@ -628,6 +618,7 @@ class ConfigManager:
628
618
  # env vars are next precedence
629
619
  if value is None and defs[config].get('env'):
630
620
  value, origin = self._loop_entries(os.environ, defs[config]['env'])
621
+ value = _tags.TrustedAsTemplate().tag(value)
631
622
  origin = 'env: %s' % origin
632
623
 
633
624
  # try config file entries next, if we have one
@@ -642,7 +633,7 @@ class ConfigManager:
642
633
  for entry in defs[config][ftype]:
643
634
  # load from config
644
635
  if ftype == 'ini':
645
- temp_value = get_ini_config_value(self._parsers[cfile], entry)
636
+ temp_value = self._get_ini_config_value(cfile, entry.get('section', 'defaults'), entry['key'])
646
637
  elif ftype == 'yaml':
647
638
  raise AnsibleError('YAML configuration type has not been implemented yet')
648
639
  else:
@@ -724,6 +715,32 @@ class ConfigManager:
724
715
 
725
716
  self._plugins[plugin_type][name] = defs
726
717
 
718
+ def _get_ini_config_value(self, config_file: str, section: str, option: str) -> t.Any:
719
+ """
720
+ Fetch `option` from the specified `section`.
721
+ Returns `None` if the specified `section` or `option` are not present.
722
+ Origin and TrustedAsTemplate tags are applied to returned values.
723
+
724
+ CAUTION: Although INI sourced configuration values are trusted for templating, that does not automatically mean they will be templated.
725
+ It is up to the code consuming configuration values to apply templating if required.
726
+ """
727
+ parser = self._parsers[config_file]
728
+ value = parser.get(section, option, raw=True, fallback=None)
729
+
730
+ if value is not None:
731
+ value = self._apply_tags(value, section, option)
732
+
733
+ return value
734
+
735
+ def _apply_tags(self, value: str, section: str, option: str) -> t.Any:
736
+ """Apply origin and trust to the given `value` sourced from the stated `section` and `option`."""
737
+ description = f'section {section!r} option {option!r}'
738
+ origin = _tags.Origin(path=self._config_file, description=description)
739
+ tags = [origin, _tags.TrustedAsTemplate()]
740
+ value = AnsibleTagHelper.tag(value, tags)
741
+
742
+ return value
743
+
727
744
  @staticmethod
728
745
  def get_deprecated_msg_from_config(dep_docs, include_removal=False, collection_name=None):
729
746
 
@@ -1129,7 +1129,7 @@ class TaskExecutor:
1129
1129
  # let action plugin override module, fallback to 'normal' action plugin otherwise
1130
1130
  elif self._shared_loader_obj.action_loader.has_plugin(self._task.action, collection_list=collections):
1131
1131
  handler_name = self._task.action
1132
- elif all((module_prefix in C.NETWORK_GROUP_MODULES, self._shared_loader_obj.action_loader.has_plugin(network_action, collection_list=collections))):
1132
+ elif module_prefix in C.NETWORK_GROUP_MODULES and self._shared_loader_obj.action_loader.has_plugin(network_action, collection_list=collections):
1133
1133
  handler_name = network_action
1134
1134
  display.vvvv("Using network group action {handler} for {action}".format(handler=handler_name,
1135
1135
  action=self._task.action),
@@ -17,6 +17,6 @@
17
17
 
18
18
  from __future__ import annotations
19
19
 
20
- __version__ = '2.19.0rc1'
20
+ __version__ = '2.19.0rc2'
21
21
  __author__ = 'Ansible, Inc.'
22
22
  __codename__ = "What Is and What Should Never Be"
@@ -23,8 +23,9 @@ DOCUMENTATION:
23
23
  default: True
24
24
  version_added: '2.9'
25
25
  allow_nan:
26
- description: When V(False), strict adherence to float value limits of the JSON specifications, so C(nan), C(inf) and C(-inf) values will produce errors.
27
- When V(True), JavaScript equivalents will be used (C(NaN), C(Infinity), C(-Infinity)).
26
+ description:
27
+ - When V(False), out-of-range float values C(nan), C(inf) and C(-inf) will result in an error.
28
+ - When V(True), out-of-range float values will be represented using their JavaScript equivalents, C(NaN), C(Infinity) and C(-Infinity).
28
29
  default: True
29
30
  type: bool
30
31
  check_circular:
@@ -42,8 +43,11 @@ DOCUMENTATION:
42
43
  separators:
43
44
  description: The C(item) and C(key) separator to be used in the serialized output,
44
45
  default may change depending on O(indent) and Python version.
45
- default: "(', ', ': ')"
46
- type: tuple
46
+ default:
47
+ - ', '
48
+ - ': '
49
+ type: list
50
+ elements: str
47
51
  skipkeys:
48
52
  description: If V(True), keys that are not basic Python types will be skipped.
49
53
  default: False
@@ -23,8 +23,9 @@ DOCUMENTATION:
23
23
  default: True
24
24
  version_added: '2.9'
25
25
  allow_nan:
26
- description: When V(False), strict adherence to float value limits of the JSON specification, so C(nan), C(inf) and C(-inf) values will produce errors.
27
- When V(True), JavaScript equivalents will be used (C(NaN), C(Infinity), C(-Infinity)).
26
+ description:
27
+ - When V(False), out-of-range float values C(nan), C(inf) and C(-inf) will result in an error.
28
+ - When V(True), out-of-range float values will be represented using their JavaScript equivalents, C(NaN), C(Infinity) and C(-Infinity).
28
29
  default: True
29
30
  type: bool
30
31
  check_circular:
ansible/release.py CHANGED
@@ -17,6 +17,6 @@
17
17
 
18
18
  from __future__ import annotations
19
19
 
20
- __version__ = '2.19.0rc1'
20
+ __version__ = '2.19.0rc2'
21
21
  __author__ = 'Ansible, Inc.'
22
22
  __codename__ = "What Is and What Should Never Be"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ansible-core
3
- Version: 2.19.0rc1
3
+ Version: 2.19.0rc2
4
4
  Summary: Radically simple IT automation
5
5
  Author: Ansible Project
6
6
  Project-URL: Homepage, https://ansible.com/
@@ -3,7 +3,7 @@ ansible/__main__.py,sha256=24j-7-YT4lZ2fmV80JD-VRoYBnxR7YoP_VP-orJtDt0,796
3
3
  ansible/constants.py,sha256=qef45QpHi-yFFMvllvNKmqFpXdKKr304e5fEZnjgwZc,7989
4
4
  ansible/context.py,sha256=oKYyfjfWpy8vDeProtqfnqSmuij_t75_5e5t0U_hQ1g,1933
5
5
  ansible/keyword_desc.yml,sha256=5rGCsr-0B8w2D67qBD6q_2WFxfqj9ieb0V_2J-dZJ5E,7547
6
- ansible/release.py,sha256=cmY3ehX6O1d-RO_lV9fseR-8fg1l2e8lO-bdrkkvrp4,855
6
+ ansible/release.py,sha256=qCP2EaY13XWVWR3uCmx_MvZnMzQPifDVbizi9KduCF4,855
7
7
  ansible/_internal/__init__.py,sha256=J3yCEAZoJLwxHMPEIWHwX6seRTCQ4Sr7cfHSw11ik9k,2208
8
8
  ansible/_internal/_collection_proxy.py,sha256=V3Zns3jdWR1hTP6q4mrNWoIKL67ayiQFPDOb6F7igsc,1228
9
9
  ansible/_internal/_event_formatting.py,sha256=cHMsuYi6v2W3fgEYdKLSe8O34kW5bZE26zyj7FOt268,4222
@@ -96,7 +96,7 @@ ansible/compat/importlib_resources.py,sha256=75SJApiBzBKuBDknj81vdfzSJSxc2Pi4Yvg
96
96
  ansible/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
97
97
  ansible/config/ansible_builtin_runtime.yml,sha256=nwL_-rqEEmpuSHxZH70pJBiEosDKOPkYIboH3_7LVEY,376076
98
98
  ansible/config/base.yml,sha256=ngUgoogdN4DOf1JrxgvlvDT5drS8yB0HktcWTcPyfB0,90545
99
- ansible/config/manager.py,sha256=CC-JhhK4KN07rvXAfiex4sxjFSVtxsLx6E_YnpEOE88,31123
99
+ ansible/config/manager.py,sha256=gDnx5rCu4cYGaxgBGUCupPGG4Tc_Tano7VpTiBjwWDo,32159
100
100
  ansible/errors/__init__.py,sha256=W1s19PaheqXMI2yKnZCuaKKjSAJRPgU1_xF2_J9B1NU,16353
101
101
  ansible/executor/__init__.py,sha256=mRvbCJPA-_veSG5ka3v04G5vsarLVDeB3EWFsu6geSI,749
102
102
  ansible/executor/interpreter_discovery.py,sha256=UWeAxnHknJCci2gG3zt6edx5Nj4WbHYfJVcmW_DzItY,3858
@@ -104,7 +104,7 @@ ansible/executor/module_common.py,sha256=sXMOvKj_9ubeBaCPVBHh76uHaRYZm-8mOhsSG55
104
104
  ansible/executor/play_iterator.py,sha256=OY0W7x3F7VUQCjWIogkPqhvm7SFnxOXR5anlqJjHeHY,32282
105
105
  ansible/executor/playbook_executor.py,sha256=5wjvqw22RG4g_JlYDQnLFrUEa8aYQBWdgKhEpNonhKQ,14806
106
106
  ansible/executor/stats.py,sha256=Rw-Q73xYvXnYOt-LJFnHAR03NvVR3ESgbMkHnVGhIPI,3180
107
- ansible/executor/task_executor.py,sha256=jt2uJOnmupi_hGIeztoX3h_cxPj_EgpRfPjNE8yh2dg,61232
107
+ ansible/executor/task_executor.py,sha256=HHbKYNqvDF50a9abEfzUy7Cl9gWAEZAXWF2F6xQV9dQ,61228
108
108
  ansible/executor/task_queue_manager.py,sha256=CpfB_807ADoPmWVV02JTEx7dA5JBwPy-uYL6fSOXDvg,18786
109
109
  ansible/executor/task_result.py,sha256=e73P110j8hcw9wv8O7p-z6St5VIvyP6iOV4cW4sswV8,10254
110
110
  ansible/executor/discovery/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -211,7 +211,7 @@ ansible/inventory/host.py,sha256=cZw906LeMYe6oF3ZxW6K2HWoW2Qc0jxHssg_C8cRumE,493
211
211
  ansible/inventory/manager.py,sha256=fxg2sq7s-VBJnn9TvJCgv-xvYIu0DLJTix_y3w0wLcc,31811
212
212
  ansible/module_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
213
213
  ansible/module_utils/_text.py,sha256=VkWgAnSNVCbTQqZgllUObBFsH3uM4EUW5srl1UR9t1g,544
214
- ansible/module_utils/ansible_release.py,sha256=cmY3ehX6O1d-RO_lV9fseR-8fg1l2e8lO-bdrkkvrp4,855
214
+ ansible/module_utils/ansible_release.py,sha256=qCP2EaY13XWVWR3uCmx_MvZnMzQPifDVbizi9KduCF4,855
215
215
  ansible/module_utils/api.py,sha256=8BmCzQtp9rClsLGlDn4I9iJrUFLCdnoEIxYX59_IL9c,5756
216
216
  ansible/module_utils/basic.py,sha256=B3RnxUfoIswGK8-o23kubNqrqHv_9aibfD8LjR3LUYE,89793
217
217
  ansible/module_utils/connection.py,sha256=ZwtQEs-TtT-XecoEmFWiDevSkJLIj348YkiW6PP7G9E,7471
@@ -629,8 +629,8 @@ ansible/plugins/filter/subelements.yml,sha256=JKHy2GRpOi5zLXZVRtmZoIs_J8sDEuAR0q
629
629
  ansible/plugins/filter/symmetric_difference.yml,sha256=2eqzKo8ZCtAY6xxd5f74TEHNhZ6rVeQVimMSRO_DgnU,1094
630
630
  ansible/plugins/filter/ternary.yml,sha256=HXfaNHqsRc698BBAxIBK11vMJnlYXOf6cpNIky8H41g,1555
631
631
  ansible/plugins/filter/to_datetime.yml,sha256=xm6YuP9cCV-5OzRxO0y8YKZuOt0nBYZe2tJHqtDUzfM,2691
632
- ansible/plugins/filter/to_json.yml,sha256=hIz4ppnypmQ-w9bn4zz1eGlK8xQ0rVaPGB4TWz3D2P0,2756
633
- ansible/plugins/filter/to_nice_json.yml,sha256=70ebCkLGbAsWGvXkrwu7kbILlWxgXBUad_RqUC9vWeY,2530
632
+ ansible/plugins/filter/to_json.yml,sha256=83GtE5oGoimh6RzkkY7cuF4-hqolzoD46WCRAtXzkOI,2791
633
+ ansible/plugins/filter/to_nice_json.yml,sha256=ezx2wgb3SG_mQh_B7aRDeWZqg65YTuh1zUonCjhtsTQ,2532
634
634
  ansible/plugins/filter/to_nice_yaml.yml,sha256=r1rmOXmDDt9FRX9fwAma6o5oRw7QOAlDnOWyIzEgD64,1510
635
635
  ansible/plugins/filter/to_uuid.yml,sha256=MA3ne76BORb2LBjginpFoPZYeQAvwd0fsZt_I5VjZMw,785
636
636
  ansible/plugins/filter/to_yaml.yml,sha256=nm3Pw0Bfnp9-hiypx9ufnOgoqXnrOODS_hPJfHhDfpQ,1593
@@ -788,12 +788,12 @@ ansible/vars/hostvars.py,sha256=cRK_4dssUwIN4aDxxYXEj7KzTazrykQ4PbJotne5oJc,4364
788
788
  ansible/vars/manager.py,sha256=1SNGcwMTT7m8aPC45DHdkOZRtnf7OEcuExBtocJusq4,28023
789
789
  ansible/vars/plugins.py,sha256=8svEABS2yBPzEdymdsrZ-0D70boUoCNvcgkWasvtVNo,4533
790
790
  ansible/vars/reserved.py,sha256=NgxlMBm_tloqDVb5TEX4eGhpYsz_AO6-Fmyi3kJpIFk,3107
791
- ansible_core-2.19.0rc1.dist-info/licenses/COPYING,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
792
- ansible_core-2.19.0rc1.dist-info/licenses/licenses/Apache-License.txt,sha256=y16Ofl9KOYjhBjwULGDcLfdWBfTEZRXnduOspt-XbhQ,11325
793
- ansible_core-2.19.0rc1.dist-info/licenses/licenses/BSD-3-Clause.txt,sha256=la0N3fE3Se8vBiuvUcFKA8b-E41G7flTic6P8CkUroE,1548
794
- ansible_core-2.19.0rc1.dist-info/licenses/licenses/MIT-license.txt,sha256=jLXp2XurnyZKbye40g9tfmLGtVlxh3pPD4n8xNqX8xc,1023
795
- ansible_core-2.19.0rc1.dist-info/licenses/licenses/PSF-license.txt,sha256=g7BC_H1qyg8Q1o5F76Vrm8ChSWYI5-dyj-CdGlNKBUo,2484
796
- ansible_core-2.19.0rc1.dist-info/licenses/licenses/simplified_bsd.txt,sha256=8R5R7R7sOa0h1Fi6RNgFgHowHBfun-OVOMzJ4rKAk2w,1237
791
+ ansible_core-2.19.0rc2.dist-info/licenses/COPYING,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
792
+ ansible_core-2.19.0rc2.dist-info/licenses/licenses/Apache-License.txt,sha256=y16Ofl9KOYjhBjwULGDcLfdWBfTEZRXnduOspt-XbhQ,11325
793
+ ansible_core-2.19.0rc2.dist-info/licenses/licenses/BSD-3-Clause.txt,sha256=la0N3fE3Se8vBiuvUcFKA8b-E41G7flTic6P8CkUroE,1548
794
+ ansible_core-2.19.0rc2.dist-info/licenses/licenses/MIT-license.txt,sha256=jLXp2XurnyZKbye40g9tfmLGtVlxh3pPD4n8xNqX8xc,1023
795
+ ansible_core-2.19.0rc2.dist-info/licenses/licenses/PSF-license.txt,sha256=g7BC_H1qyg8Q1o5F76Vrm8ChSWYI5-dyj-CdGlNKBUo,2484
796
+ ansible_core-2.19.0rc2.dist-info/licenses/licenses/simplified_bsd.txt,sha256=8R5R7R7sOa0h1Fi6RNgFgHowHBfun-OVOMzJ4rKAk2w,1237
797
797
  ansible_test/__init__.py,sha256=20VPOj11c6Ut1Av9RaurgwJvFhMqkWG3vAvcCbecNKw,66
798
798
  ansible_test/_data/ansible.cfg,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
799
799
  ansible_test/_data/coveragerc,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -1090,8 +1090,8 @@ ansible_test/config/cloud-config-vultr.ini.template,sha256=XLKHk3lg_8ReQMdWfZzhh
1090
1090
  ansible_test/config/config.yml,sha256=1zdGucnIl6nIecZA7ISIANvqXiHWqq6Dthsk_6MUwNc,2642
1091
1091
  ansible_test/config/inventory.networking.template,sha256=bFNSk8zNQOaZ_twaflrY0XZ9mLwUbRLuNT0BdIFwvn4,1335
1092
1092
  ansible_test/config/inventory.winrm.template,sha256=1QU8W-GFLnYEw8yY9bVIvUAVvJYPM3hyoijf6-M7T00,1098
1093
- ansible_core-2.19.0rc1.dist-info/METADATA,sha256=QnBK_jFoYoWx_2nkKML2MmP1NZ8LnR7yuw7zC7CwtIY,7733
1094
- ansible_core-2.19.0rc1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
1095
- ansible_core-2.19.0rc1.dist-info/entry_points.txt,sha256=S9yJij5Im6FgRQxzkqSCnPQokC7PcWrDW_NSygZczJU,451
1096
- ansible_core-2.19.0rc1.dist-info/top_level.txt,sha256=IFbRLjAvih1DYzJWg3_F6t4sCzEMxRO7TOMNs6GkYHo,21
1097
- ansible_core-2.19.0rc1.dist-info/RECORD,,
1093
+ ansible_core-2.19.0rc2.dist-info/METADATA,sha256=kSnjj8aI3_xFEajstyVBCeVcA-RPKRqetQMkwUHHVko,7733
1094
+ ansible_core-2.19.0rc2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
1095
+ ansible_core-2.19.0rc2.dist-info/entry_points.txt,sha256=S9yJij5Im6FgRQxzkqSCnPQokC7PcWrDW_NSygZczJU,451
1096
+ ansible_core-2.19.0rc2.dist-info/top_level.txt,sha256=IFbRLjAvih1DYzJWg3_F6t4sCzEMxRO7TOMNs6GkYHo,21
1097
+ ansible_core-2.19.0rc2.dist-info/RECORD,,