summaryrefslogtreecommitdiff
path: root/lib/ansible/parsing/mod_args.py
diff options
context:
space:
mode:
authorMatt Martz <matt@sivel.net>2019-01-23 11:40:07 -0600
committerGitHub <noreply@github.com>2019-01-23 11:40:07 -0600
commit8c08d039896488f6694a54640a0bdd69baba5fa1 (patch)
tree17a605f35b6e85aacebba484b7d6c88a9e05394d /lib/ansible/parsing/mod_args.py
parentad57efff8f99f8b59408d0d815f69a9c6a4c1bfa (diff)
downloadansible-8c08d039896488f6694a54640a0bdd69baba5fa1.tar.gz
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
Diffstat (limited to 'lib/ansible/parsing/mod_args.py')
-rw-r--r--lib/ansible/parsing/mod_args.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/ansible/parsing/mod_args.py b/lib/ansible/parsing/mod_args.py
index 7ef4e3f801..5de5ed918f 100644
--- a/lib/ansible/parsing/mod_args.py
+++ b/lib/ansible/parsing/mod_args.py
@@ -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