test connection without needing admin rights (#7947)

SHOW DIAGNOSTICS always needs admin privileges on influxdb. For
the purposes of home-assistant this is too much.
Use 'SHOW SERIES' to have a relatively lightweight query which
only needs READ privileges.
This commit is contained in:
Michael Heinemann 2017-06-08 12:26:37 +02:00 committed by Pascal Vizeli
parent 9bea7d7d8b
commit 727a22f925

View file

@ -96,7 +96,7 @@ def setup(hass, config):
try:
influx = InfluxDBClient(**kwargs)
influx.query("SHOW DIAGNOSTICS;", database=conf[CONF_DB_NAME])
influx.query("SHOW SERIES LIMIT 1;", database=conf[CONF_DB_NAME])
except exceptions.InfluxDBClientError as exc:
_LOGGER.error("Database host is not accessible due to '%s', please "
"check your entries in the configuration file and that "