From 8e32dda2e2efee3b391394383cb24b2e7a19f267 Mon Sep 17 00:00:00 2001 From: Sergei Antipov Date: Mon, 10 Nov 2014 15:41:44 +0600 Subject: [PATCH] Delete import json. Several syntax changes. Import json called twice. In first it will call an exception, if json module not installed. --- plugins/inventory/zabbix.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/plugins/inventory/zabbix.py b/plugins/inventory/zabbix.py index 68cc5cc57b3..2bc1e2e1ccc 100755 --- a/plugins/inventory/zabbix.py +++ b/plugins/inventory/zabbix.py @@ -20,7 +20,7 @@ ###################################################################### """ -Zabbix Server external inventory script. +Zabbix Server external inventory script. ======================================== Returns hosts and hostgroups from Zabbix Server. @@ -31,7 +31,6 @@ Tested with Zabbix Server 2.0.6. """ import os, sys -import json import argparse import ConfigParser @@ -55,7 +54,7 @@ class ZabbixInventory(object): if config.has_option('zabbix', 'server'): self.zabbix_server = config.get('zabbix', 'server') - # login + # login if config.has_option('zabbix', 'username'): self.zabbix_username = config.get('zabbix', 'username') if config.has_option('zabbix', 'password'): @@ -84,7 +83,7 @@ class ZabbixInventory(object): for host in hostsData: hostname = host['name'] - data[self.defaultgroup]['hosts'].append(hostname) + data[self.defaultgroup]['hosts'].append(hostname) for group in host['groups']: groupname = group['name']