Fix iteritems() (#5)

fix: replace deprecated `iteritems` with `items`

* Add files via upload

Adjusted *.iteritems() to *.items() which will work for Python 3 aswell as Python 2 (since iteritems is outdated for python3 and breaks the salt-state).

* Delete Alerts

* Delete Probes

* Delete Targets

* Update Alerts

* Update Probes

* Update Targets
This commit is contained in:
jhelmich2 2019-09-02 19:50:10 +02:00 committed by Imran Iqbal
parent 1cfbec0d38
commit 65b2c516ec
3 changed files with 5 additions and 5 deletions

View File

@ -4,10 +4,10 @@
to = {{ salt['pillar.get']('smokeping:alerts:to', 'alertee@address.somewhere') }} to = {{ salt['pillar.get']('smokeping:alerts:to', 'alertee@address.somewhere') }}
from = {{ salt['pillar.get']('smokeping:alerts:from', 'smokealert@company.xy') }} from = {{ salt['pillar.get']('smokeping:alerts:from', 'smokealert@company.xy') }}
{% for alert, options in smokeping.alerts.iteritems() -%} {% for alert, options in smokeping.alerts.items() -%}
{% if options is mapping() %} {% if options is mapping() %}
+ {{ alert }} + {{ alert }}
{% for key, value in options.iteritems() -%} {% for key, value in options.items() -%}
{{ key }} = {{ value }} {{ key }} = {{ value }}
{% endfor %} {% endfor %}

View File

@ -1,7 +1,7 @@
{%- from "smokeping/map.jinja" import smokeping with context -%} {%- from "smokeping/map.jinja" import smokeping with context -%}
*** Probes *** *** Probes ***
{% for probe, settings in smokeping.probes.iteritems() %} {% for probe, settings in smokeping.probes.items() %}
+ {{ probe }} + {{ probe }}
{% for key, value in settings.items() %} {% for key, value in settings.items() %}
{{ key }} = {{ value }} {{ key }} = {{ value }}

View File

@ -8,11 +8,11 @@ title = {{ smokeping.targets.title }}
remark = {{ salt['pillar.get']('smokeping:targets:remark', '') }} remark = {{ salt['pillar.get']('smokeping:targets:remark', '') }}
alerts = {{ salt['pillar.get']('smokeping:targets:alerts', '') }} alerts = {{ salt['pillar.get']('smokeping:targets:alerts', '') }}
{% for target, options in smokeping.targets.iteritems() -%} {% for target, options in smokeping.targets.items() -%}
{% if options is mapping() -%} {% if options is mapping() -%}
+ {{ target }} + {{ target }}
{% for key, value in options.iteritems() -%} {% for key, value in options.items() -%}
{{ key }} = {{ value }} {{ key }} = {{ value }}
{% endfor %} {% endfor %}