ansible-core 2.19.0b2__py3-none-any.whl → 2.19.0b3__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.
Files changed (70) hide show
  1. ansible/_internal/_ansiballz.py +1 -4
  2. ansible/_internal/_templating/_datatag.py +3 -4
  3. ansible/_internal/_templating/_engine.py +6 -1
  4. ansible/_internal/_templating/_jinja_plugins.py +2 -6
  5. ansible/cli/__init__.py +3 -2
  6. ansible/cli/arguments/option_helpers.py +4 -1
  7. ansible/cli/doc.py +0 -1
  8. ansible/config/manager.py +2 -2
  9. ansible/constants.py +0 -62
  10. ansible/errors/__init__.py +6 -2
  11. ansible/executor/module_common.py +11 -7
  12. ansible/executor/task_executor.py +6 -8
  13. ansible/galaxy/api.py +1 -1
  14. ansible/galaxy/collection/__init__.py +3 -3
  15. ansible/module_utils/_internal/_ansiballz.py +4 -30
  16. ansible/module_utils/_internal/_datatag/_tags.py +3 -25
  17. ansible/module_utils/_internal/_deprecator.py +134 -0
  18. ansible/module_utils/_internal/_plugin_info.py +25 -0
  19. ansible/module_utils/_internal/_validation.py +14 -0
  20. ansible/module_utils/ansible_release.py +1 -1
  21. ansible/module_utils/basic.py +64 -17
  22. ansible/module_utils/common/arg_spec.py +8 -3
  23. ansible/module_utils/common/messages.py +40 -23
  24. ansible/module_utils/common/process.py +0 -1
  25. ansible/module_utils/common/respawn.py +0 -7
  26. ansible/module_utils/common/warnings.py +13 -13
  27. ansible/module_utils/datatag.py +13 -13
  28. ansible/modules/async_status.py +1 -1
  29. ansible/modules/dnf5.py +1 -1
  30. ansible/modules/get_url.py +1 -1
  31. ansible/playbook/task.py +0 -2
  32. ansible/plugins/__init__.py +18 -8
  33. ansible/plugins/action/__init__.py +6 -14
  34. ansible/plugins/action/gather_facts.py +2 -4
  35. ansible/plugins/callback/oneline.py +7 -1
  36. ansible/plugins/callback/tree.py +7 -1
  37. ansible/plugins/connection/local.py +1 -1
  38. ansible/plugins/connection/paramiko_ssh.py +9 -2
  39. ansible/plugins/doc_fragments/action_core.py +1 -1
  40. ansible/plugins/filter/core.py +4 -1
  41. ansible/plugins/inventory/__init__.py +2 -2
  42. ansible/plugins/loader.py +194 -130
  43. ansible/plugins/lookup/url.py +2 -2
  44. ansible/plugins/strategy/__init__.py +6 -6
  45. ansible/release.py +1 -1
  46. ansible/template/__init__.py +1 -1
  47. ansible/utils/collection_loader/_collection_meta.py +5 -3
  48. ansible/utils/display.py +133 -71
  49. ansible/utils/py3compat.py +1 -7
  50. ansible/utils/ssh_functions.py +4 -1
  51. ansible/vars/manager.py +18 -10
  52. ansible/vars/plugins.py +4 -4
  53. {ansible_core-2.19.0b2.dist-info → ansible_core-2.19.0b3.dist-info}/METADATA +1 -1
  54. {ansible_core-2.19.0b2.dist-info → ansible_core-2.19.0b3.dist-info}/RECORD +67 -65
  55. ansible_test/_internal/commands/sanity/pylint.py +1 -0
  56. ansible_test/_internal/docker_util.py +4 -3
  57. ansible_test/_util/controller/sanity/pylint/plugins/deprecated_calls.py +475 -0
  58. ansible_test/_util/controller/sanity/pylint/plugins/deprecated_comment.py +137 -0
  59. ansible/module_utils/_internal/_dataclass_annotation_patch.py +0 -64
  60. ansible/module_utils/_internal/_plugin_exec_context.py +0 -49
  61. ansible_test/_util/controller/sanity/pylint/plugins/deprecated.py +0 -399
  62. {ansible_core-2.19.0b2.dist-info → ansible_core-2.19.0b3.dist-info}/Apache-License.txt +0 -0
  63. {ansible_core-2.19.0b2.dist-info → ansible_core-2.19.0b3.dist-info}/BSD-3-Clause.txt +0 -0
  64. {ansible_core-2.19.0b2.dist-info → ansible_core-2.19.0b3.dist-info}/COPYING +0 -0
  65. {ansible_core-2.19.0b2.dist-info → ansible_core-2.19.0b3.dist-info}/MIT-license.txt +0 -0
  66. {ansible_core-2.19.0b2.dist-info → ansible_core-2.19.0b3.dist-info}/PSF-license.txt +0 -0
  67. {ansible_core-2.19.0b2.dist-info → ansible_core-2.19.0b3.dist-info}/WHEEL +0 -0
  68. {ansible_core-2.19.0b2.dist-info → ansible_core-2.19.0b3.dist-info}/entry_points.txt +0 -0
  69. {ansible_core-2.19.0b2.dist-info → ansible_core-2.19.0b3.dist-info}/simplified_bsd.txt +0 -0
  70. {ansible_core-2.19.0b2.dist-info → ansible_core-2.19.0b3.dist-info}/top_level.txt +0 -0
@@ -28,10 +28,8 @@ class ActionModule(ActionBase):
28
28
 
29
29
  # TODO: remove in favor of controller side argspec detecting valid arguments
30
30
  # network facts modules must support gather_subset
31
- try:
32
- name = self._connection.ansible_name.removeprefix('ansible.netcommon.')
33
- except AttributeError:
34
- name = self._connection._load_name.split('.')[-1]
31
+ name = self._connection.ansible_name.removeprefix('ansible.netcommon.')
32
+
35
33
  if name not in ('network_cli', 'httpapi', 'netconf'):
36
34
  subset = mod_args.pop('gather_subset', None)
37
35
  if subset not in ('all', ['all'], None):
@@ -17,6 +17,7 @@ from ansible import constants as C
17
17
  from ansible.plugins.callback import CallbackBase
18
18
  from ansible.template import Templar
19
19
  from ansible.executor.task_result import CallbackTaskResult
20
+ from ansible.module_utils._internal import _deprecator
20
21
 
21
22
 
22
23
  class CallbackModule(CallbackBase):
@@ -32,7 +33,12 @@ class CallbackModule(CallbackBase):
32
33
 
33
34
  def __init__(self, *args, **kwargs):
34
35
  super().__init__(*args, **kwargs)
35
- self._display.deprecated('The oneline callback plugin is deprecated.', version='2.23')
36
+
37
+ self._display.deprecated( # pylint: disable=ansible-deprecated-unnecessary-collection-name
38
+ msg='The oneline callback plugin is deprecated.',
39
+ version='2.23',
40
+ deprecator=_deprecator.ANSIBLE_CORE_DEPRECATOR, # entire plugin being removed; this improves the messaging
41
+ )
36
42
 
37
43
  def _command_generic_msg(self, hostname, result, caption):
38
44
  stdout = result.get('stdout', '').replace('\n', '\\n').replace('\r', '\\r')
@@ -34,6 +34,7 @@ from ansible.executor.task_result import CallbackTaskResult
34
34
  from ansible.module_utils.common.text.converters import to_bytes, to_text
35
35
  from ansible.plugins.callback import CallbackBase
36
36
  from ansible.utils.path import makedirs_safe, unfrackpath
37
+ from ansible.module_utils._internal import _deprecator
37
38
 
38
39
 
39
40
  class CallbackModule(CallbackBase):
@@ -48,7 +49,12 @@ class CallbackModule(CallbackBase):
48
49
 
49
50
  def __init__(self, *args, **kwargs):
50
51
  super().__init__(*args, **kwargs)
51
- self._display.deprecated('The tree callback plugin is deprecated.', version='2.23')
52
+
53
+ self._display.deprecated( # pylint: disable=ansible-deprecated-unnecessary-collection-name
54
+ msg='The tree callback plugin is deprecated.',
55
+ version='2.23',
56
+ deprecator=_deprecator.ANSIBLE_CORE_DEPRECATOR, # entire plugin being removed; this improves the messaging
57
+ )
52
58
 
53
59
  def set_options(self, task_keys=None, var_options=None, direct=None):
54
60
  """ override to set self.tree """
@@ -252,7 +252,7 @@ class Connection(ConnectionBase):
252
252
  def _become_success_timeout(self) -> int:
253
253
  """Timeout value for become success in seconds."""
254
254
  if (timeout := self.get_option('become_success_timeout')) < 1:
255
- timeout = C.config.get_configuration_definitions('connection', 'local')['become_success_timeout']['default']
255
+ timeout = C.config.get_config_default('become_success_timeout', plugin_type='connection', plugin_name='local')
256
256
 
257
257
  return timeout
258
258
 
@@ -248,11 +248,13 @@ from ansible.errors import (
248
248
  AnsibleError,
249
249
  AnsibleFileNotFound,
250
250
  )
251
+
252
+ from ansible.module_utils.common.text.converters import to_bytes, to_native, to_text
251
253
  from ansible.module_utils.compat.paramiko import _PARAMIKO_IMPORT_ERR as PARAMIKO_IMPORT_ERR, _paramiko as paramiko
252
254
  from ansible.plugins.connection import ConnectionBase
253
255
  from ansible.utils.display import Display
254
256
  from ansible.utils.path import makedirs_safe
255
- from ansible.module_utils.common.text.converters import to_bytes, to_native, to_text
257
+ from ansible.module_utils._internal import _deprecator
256
258
 
257
259
  display = Display()
258
260
 
@@ -327,7 +329,12 @@ class Connection(ConnectionBase):
327
329
  _log_channel: str | None = None
328
330
 
329
331
  def __init__(self, *args, **kwargs):
330
- display.deprecated('The paramiko connection plugin is deprecated.', version='2.21')
332
+ display.deprecated( # pylint: disable=ansible-deprecated-unnecessary-collection-name
333
+ msg='The paramiko connection plugin is deprecated.',
334
+ version='2.21',
335
+ deprecator=_deprecator.ANSIBLE_CORE_DEPRECATOR, # entire plugin being removed; this improves the messaging
336
+ )
337
+
331
338
  super().__init__(*args, **kwargs)
332
339
 
333
340
  def _cache_key(self) -> str:
@@ -29,7 +29,7 @@ attributes:
29
29
  platforms: all
30
30
  until:
31
31
  description: Denotes if this action obeys until/retry/poll keywords
32
- support: full
32
+ support: none
33
33
  tags:
34
34
  description: Allows for the 'tags' keyword to control the selection of this action for execution
35
35
  support: full
@@ -115,7 +115,10 @@ def to_bool(value: object) -> bool:
115
115
  result = value_to_check == 1 # backwards compatibility with the old code which checked: value in ('yes', 'on', '1', 'true', 1)
116
116
 
117
117
  # NB: update the doc string to reflect reality once this fallback is removed
118
- display.deprecated(f'The `bool` filter coerced invalid value {value!r} ({native_type_name(value)}) to {result!r}.', version='2.23')
118
+ display.deprecated(
119
+ msg=f'The `bool` filter coerced invalid value {value!r} ({native_type_name(value)}) to {result!r}.',
120
+ version='2.23',
121
+ )
119
122
 
120
123
  return result
121
124
 
@@ -28,7 +28,7 @@ from collections.abc import Mapping
28
28
  from ansible import template as _template
29
29
  from ansible.errors import AnsibleError, AnsibleParserError, AnsibleValueOmittedError
30
30
  from ansible.inventory.group import to_safe_group_name as original_safe
31
- from ansible.module_utils._internal import _plugin_exec_context
31
+ from ansible.module_utils._internal import _plugin_info
32
32
  from ansible.parsing.utils.addresses import parse_address
33
33
  from ansible.parsing.dataloader import DataLoader
34
34
  from ansible.plugins import AnsiblePlugin, _ConfigurablePlugin
@@ -314,7 +314,7 @@ class BaseFileInventoryPlugin(_BaseInventoryPlugin):
314
314
  super(BaseFileInventoryPlugin, self).__init__()
315
315
 
316
316
 
317
- class Cacheable(_plugin_exec_context.HasPluginInfo, _ConfigurablePlugin):
317
+ class Cacheable(_plugin_info.HasPluginInfo, _ConfigurablePlugin):
318
318
  """Mixin for inventory plugins which support caching."""
319
319
 
320
320
  _cache: CachePluginAdjudicator