mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-04 23:44:00 -07:00
Add option to prepend inherited attributes when extending values
Fixes #18483
This commit is contained in:
parent
11465134fa
commit
435ca620b2
4 changed files with 16 additions and 11 deletions
|
@ -59,7 +59,7 @@ class Conditional:
|
|||
if when is None:
|
||||
when = []
|
||||
if hasattr(self, '_get_parent_attribute'):
|
||||
when = self._get_parent_attribute('when', extend=True)
|
||||
when = self._get_parent_attribute('when', extend=True, prepend=True)
|
||||
return when
|
||||
|
||||
def evaluate_conditional(self, templar, all_vars):
|
||||
|
@ -130,5 +130,5 @@ class Conditional:
|
|||
elif "is defined" in original:
|
||||
return False
|
||||
else:
|
||||
raise AnsibleError("error while evaluating conditional (%s): %s" % (original, e))
|
||||
raise AnsibleUndefinedVariable("error while evaluating conditional (%s): %s" % (original, e))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue