Align Nagios plugins with Python3

This commit aligns Nagios plugins with Python3.
Since dict.iteritems() was removed in Python3 and substituted
with ditc.items() we have to change them in plugins.

Change-Id: I782f90a91e8dadd959c4d8537a80c44180c0b78d
This commit is contained in:
MirgDenis 2020-04-30 18:00:39 +03:00
parent f3744bea22
commit 548c599498
2 changed files with 2 additions and 2 deletions

View File

@ -73,7 +73,7 @@ def main():
if metrics:
criticalMessages = []
warningMessages = []
for key, value in metrics.iteritems():
for key, value in metrics.items():
if value == args.critical:
criticalMessages.append("Critical: {metric_name} metric is a critical value of {metric_value}({detail})".format(
metric_name=args.health_metric, metric_value=value, detail=key))

View File

@ -118,7 +118,7 @@ def update_config_file(object_file_loc):
def get_nagios_hostgroups(node_list):
hostgroup_labels = set()
for host, labels in get_nagios_hostgroups_dictionary(
node_list).iteritems():
node_list).items():
hostgroup_labels.update(labels)
nagios_hostgroups = []