fix python3 compatibility in jinja2 template.

rename iterkeys to keys
pull/1112/head
Shengjing Zhu 2016-11-22 21:52:52 +08:00
parent 25d8ce958f
commit 3e06e39550
1 changed files with 1 additions and 1 deletions

View File

@ -35,7 +35,7 @@ mon host = {% for host in groups[mon_group_name] %}
{% set address = hostvars[host]['monitor_address'] if hostvars[host]['monitor_address'] is defined else monitor_address %}
{% set interface = hostvars[host]['monitor_interface'] if hostvars[host]['monitor_interface'] is defined else monitor_interface %}
{% if interface != "interface" %}
{% for key in hostvars[host].iterkeys() %}
{% for key in hostvars[host].keys() %}
{% if hostvars[host][key]['macaddress'] is defined and hostvars[host][key]['device'] is defined and hostvars[host][key]['device'] == interface -%}
{{ hostvars[host][key]['ipv4']['address'] }}
{%- endif %}