Restore the behavior of 2.4 to that before ebf971f9

Fixes #35065
This commit is contained in:
James Cammarata 2018-01-23 15:29:37 -06:00 committed by Toshio Kuratomi
parent 055cae3c0f
commit a21f44dc0a
2 changed files with 2 additions and 2 deletions

View file

@ -291,7 +291,7 @@ class Block(Base, Become, Conditional, Taggable):
value = self._attributes[attr]
if self._parent and (value is None or extend):
try:
if getattr(self._parent, 'statically_loaded', True):
if attr != 'when' or getattr(self._parent, 'statically_loaded', True):
if hasattr(self._parent, '_get_parent_attribute'):
parent_value = self._parent._get_parent_attribute(attr)
else:

View file

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