mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 03:41:25 -07:00
Fieldattribute inheritance with defaults (#50891)
* Add tests for check_mode at play and task level These test inheritance of check_mode from the various levels (command line, as a play attribute and as a task attribute) so they will be useful for checking that the change to fieldattribute inheritance with defaults works * Add a sentinel object The Sentinel object can be used in place of None when we need to mark an entry as being special (usually used to mark something as not having been set) * Start of using a Sentinel object instead of None. * Handle edge cases around use of Sentinel * _get_parent_attribute needs to deal in Sentinel not None * No need to special case any_errors_fatal in task.py any longer * Handle more edge cases around Sentinel * Use Sentinel instead of None in TaskInclude * Update code to clarify the vars we are copying are class attrs * Add changelog fragment * Use a default of Sentinel for delegate_to, this also allows 'delegate_to: ~' now to unset inherited delegate_to * Explain Sentinel stripping in _extend_value * Fix ModuleArgsParser tests to compare with Sentinel * Fixes for tasks inside of roles inheriting from play * Remove incorrect note. ci_complete * Remove commented code
This commit is contained in:
parent
ad57efff8f
commit
8c08d03989
14 changed files with 213 additions and 59 deletions
|
@ -25,6 +25,7 @@ from ansible.module_utils._text import to_text
|
|||
from ansible.parsing.splitter import parse_kv, split_args
|
||||
from ansible.plugins.loader import module_loader, action_loader
|
||||
from ansible.template import Templar
|
||||
from ansible.utils.sentinel import Sentinel
|
||||
|
||||
|
||||
# For filtering out modules correctly below
|
||||
|
@ -258,7 +259,7 @@ class ModuleArgsParser:
|
|||
thing = None
|
||||
|
||||
action = None
|
||||
delegate_to = self._task_ds.get('delegate_to', None)
|
||||
delegate_to = self._task_ds.get('delegate_to', Sentinel)
|
||||
args = dict()
|
||||
|
||||
# This is the standard YAML form for command-type modules. We grab
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue