Skip to content

Commit

Permalink
Added additional ini file search path into contrib/inventory/zabbix.py
Browse files Browse the repository at this point in the history
  • Loading branch information
yfix committed Oct 8, 2015
1 parent 9e364c2 commit a2422bf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion contrib/inventory/zabbix.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ class ZabbixInventory(object):

def read_settings(self):
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
if config.has_option('zabbix', 'server'):
self.zabbix_server = config.get('zabbix', 'server')
Expand Down

0 comments on commit a2422bf

Please sign in to comment.