fix issue with default name of the measurements for the influx plugin
This commit is contained in:
parent
bdaa166211
commit
208b5881b8
|
@ -28,7 +28,7 @@ def parseplugins(config):
|
||||||
# host, port, user, pass, database options
|
# host, port, user, pass, database options
|
||||||
##########################################
|
##########################################
|
||||||
plugins[section] = {}
|
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):
|
if config.has_option(section, currentoption):
|
||||||
plugins[section][currentoption] = config.get(section, currentoption)
|
plugins[section][currentoption] = config.get(section, currentoption)
|
||||||
if 'host' not in plugins[section]:
|
if 'host' not in plugins[section]:
|
||||||
|
@ -36,7 +36,7 @@ def parseplugins(config):
|
||||||
if 'port' not in plugins[section]:
|
if 'port' not in plugins[section]:
|
||||||
plugins[section]['port'] = 8086
|
plugins[section]['port'] = 8086
|
||||||
if 'measurement' not in plugins[section]:
|
if 'measurement' not in plugins[section]:
|
||||||
plugins[section]['measurement'] = 'tweets'
|
plugins[section]['measurement'] = 'toots'
|
||||||
for field in ['user', 'pass', 'database']:
|
for field in ['user', 'pass', 'database']:
|
||||||
if field not in plugins[section]:
|
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))
|
sys.exit('Parsing error for {field} in the [{section}] section: {field} is not defined'.format(field=field, section=section))
|
||||||
|
|
Loading…
Reference in a new issue