From af9396841ee47493c1cd0b57d0cca1b87d317e20 Mon Sep 17 00:00:00 2001 From: furhouse Date: Mon, 28 Aug 2017 20:12:32 +0200 Subject: [PATCH] zabbix_inventory PEP8 compliance. (#28680) --- contrib/inventory/zabbix.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/contrib/inventory/zabbix.py b/contrib/inventory/zabbix.py index b72c1271a1..d5573aa003 100755 --- a/contrib/inventory/zabbix.py +++ b/contrib/inventory/zabbix.py @@ -37,7 +37,10 @@ from __future__ import print_function import os import sys import argparse -import ConfigParser +try: + import ConfigParser as configparser +except ImportError: + import configparser try: from zabbix_api import ZabbixAPI @@ -55,7 +58,7 @@ except: class ZabbixInventory(object): def read_settings(self): - config = ConfigParser.SafeConfigParser() + config = configparser.SafeConfigParser() conf_path = './zabbix.ini' if not os.path.exists(conf_path): conf_path = os.path.dirname(os.path.realpath(__file__)) + '/zabbix.ini'