mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Added additional ini file search path into contrib/inventory/zabbix.py
This commit is contained in:
parent
9e364c2eb5
commit
a2422bfb60
1 changed files with 5 additions and 1 deletions
|
@ -52,7 +52,11 @@ class ZabbixInventory(object):
|
||||||
|
|
||||||
def read_settings(self):
|
def read_settings(self):
|
||||||
config = ConfigParser.SafeConfigParser()
|
config = ConfigParser.SafeConfigParser()
|
||||||
config.read(os.path.dirname(os.path.realpath(__file__)) + '/zabbix.ini')
|
conf_path = './zabbix.ini'
|
||||||
|
if not os.path.exists(conf_path):
|
||||||
|
conf_path = os.path.dirname(os.path.realpath(__file__)) + '/zabbix.ini'
|
||||||
|
if os.path.exists(conf_path):
|
||||||
|
config.read(conf_path)
|
||||||
# server
|
# server
|
||||||
if config.has_option('zabbix', 'server'):
|
if config.has_option('zabbix', 'server'):
|
||||||
self.zabbix_server = config.get('zabbix', 'server')
|
self.zabbix_server = config.get('zabbix', 'server')
|
||||||
|
|
Loading…
Reference in a new issue