mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-26 06:31:23 -07:00
fixes issue where filter wouldn't error on undefined var (#30921)
The filter will now correctly error on an undefined variable when trying to template the key `value`
This commit is contained in:
parent
932f62ab57
commit
909100bd2c
2 changed files with 6 additions and 10 deletions
|
@ -87,9 +87,11 @@ def parse_cli(output, tmpl):
|
|||
for name, attrs in iteritems(spec['keys']):
|
||||
value = attrs['value']
|
||||
|
||||
if template.can_template(value):
|
||||
try:
|
||||
variables = spec.get('vars', {})
|
||||
value = template(value, variables)
|
||||
except:
|
||||
pass
|
||||
|
||||
if 'start_block' in attrs and 'end_block' in attrs:
|
||||
start_block = re.compile(attrs['start_block'])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue