Make include_x inheritance more congruent with docs (#32769)

* draft making tags congruent with include_x

* remove ability to 'inline tags' for new inc keys

* generic inheritance

* fix typo

* pepe
This commit is contained in:
Brian Coca 2017-11-30 17:16:10 -05:00 committed by James Cammarata
commit 8e6ebae8bd
6 changed files with 17 additions and 5 deletions

View file

@ -420,7 +420,12 @@ class Task(Base, Conditional, Taggable, Become):
value = self._attributes[attr]
if self._parent and (value is None or extend):
if attr != 'when' or getattr(self._parent, 'statically_loaded', True):
parent_value = getattr(self._parent, attr, None)
# vars are always inheritable, other attributes might not be for the partent but still should be for other ancestors
if attr != 'vars' and not getattr(self._parent, '_inheritable', True) and hasattr(self._parent, '_get_parent_attribute'):
parent_value = self._parent._get_parent_attribute(attr, extend=extend, prepend=prepend)
else:
parent_value = getattr(self._parent, attr, None)
if extend:
value = self._extend_value(value, parent_value, prepend)
else: