fix issue with default name of the measurements for the influx plugin

This commit is contained in:
Carl Chenet 2017-08-02 17:11:01 +02:00
parent bdaa166211
commit 208b5881b8

View file

@ -28,7 +28,7 @@ def parseplugins(config):
# host, port, user, pass, database options
##########################################
plugins[section] = {}
for currentoption in ['host', 'port', 'user', 'pass', 'database']:
for currentoption in ['host', 'port', 'user', 'pass', 'database', 'measurement']:
if config.has_option(section, currentoption):
plugins[section][currentoption] = config.get(section, currentoption)
if 'host' not in plugins[section]:
@ -36,7 +36,7 @@ def parseplugins(config):
if 'port' not in plugins[section]:
plugins[section]['port'] = 8086
if 'measurement' not in plugins[section]:
plugins[section]['measurement'] = 'tweets'
plugins[section]['measurement'] = 'toots'
for field in ['user', 'pass', 'database']:
if field not in plugins[section]:
sys.exit('Parsing error for {field} in the [{section}] section: {field} is not defined'.format(field=field, section=section))