From 65b2c516ec392f56f792e479b5dcb86c5aa74eab Mon Sep 17 00:00:00 2001 From: jhelmich2 <54704425+jhelmich2@users.noreply.github.com> Date: Mon, 2 Sep 2019 19:50:10 +0200 Subject: [PATCH] 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 --- smokeping/files/Alerts | 4 ++-- smokeping/files/Probes | 2 +- smokeping/files/Targets | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/smokeping/files/Alerts b/smokeping/files/Alerts index edd0a38..f83242f 100644 --- a/smokeping/files/Alerts +++ b/smokeping/files/Alerts @@ -4,10 +4,10 @@ to = {{ salt['pillar.get']('smokeping:alerts:to', 'alertee@address.somewhere') }} 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() %} + {{ alert }} -{% for key, value in options.iteritems() -%} +{% for key, value in options.items() -%} {{ key }} = {{ value }} {% endfor %} diff --git a/smokeping/files/Probes b/smokeping/files/Probes index fa1e5b3..55dc96a 100644 --- a/smokeping/files/Probes +++ b/smokeping/files/Probes @@ -1,7 +1,7 @@ {%- from "smokeping/map.jinja" import smokeping with context -%} *** Probes *** -{% for probe, settings in smokeping.probes.iteritems() %} +{% for probe, settings in smokeping.probes.items() %} + {{ probe }} {% for key, value in settings.items() %} {{ key }} = {{ value }} diff --git a/smokeping/files/Targets b/smokeping/files/Targets index 7aaac0e..4a37928 100644 --- a/smokeping/files/Targets +++ b/smokeping/files/Targets @@ -8,11 +8,11 @@ title = {{ smokeping.targets.title }} remark = {{ salt['pillar.get']('smokeping:targets:remark', '') }} 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() -%} + {{ target }} -{% for key, value in options.iteritems() -%} +{% for key, value in options.items() -%} {{ key }} = {{ value }} {% endfor %}