[2.9] zabbix_template: fixed zabbix no longer returning macros as part of the template (#69235)

* fixed zabbix no longer returning macros as part of the template (#66996)


(cherry picked from commit c80d0c40ce)

* added changelog fragment
pull/69271/head
Dusan Matejka 5 years ago committed by GitHub
parent 99e6f4ff54
commit 28cc8e6155
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- zabbix_template - no longer fails with KeyError when there are no macros present in existing template (see https://github.com/ansible-collections/community.zabbix/issues/19)

@ -417,6 +417,9 @@ class Template(object):
changed = True changed = True
break break
if 'macros' not in existing_template['zabbix_export']['templates'][0]:
existing_template['zabbix_export']['templates'][0]['macros'] = []
if template_macros is not None: if template_macros is not None:
existing_macros = existing_template['zabbix_export']['templates'][0]['macros'] existing_macros = existing_template['zabbix_export']['templates'][0]['macros']
if template_macros != existing_macros: if template_macros != existing_macros:

Loading…
Cancel
Save