aboutsummaryrefslogtreecommitdiffstats
path: root/api/resources/v2/containers.py
diff options
context:
space:
mode:
Diffstat (limited to 'api/resources/v2/containers.py')
-rw-r--r--api/resources/v2/containers.py14
1 files changed, 4 insertions, 10 deletions
diff --git a/api/resources/v2/containers.py b/api/resources/v2/containers.py
index 66dc94120..ee1903901 100644
--- a/api/resources/v2/containers.py
+++ b/api/resources/v2/containers.py
@@ -272,21 +272,15 @@ class V2Containers(ApiResource):
def _create_data_source(self, ip):
url = 'http://admin:admin@{}:{}/api/datasources'.format(ip, 3000)
-
- influx_conf = utils.parse_ini_file(consts.CONF_FILE)
- try:
- influx_url = influx_conf['dispatcher_influxdb']['target']
- except KeyError:
- LOG.exception('influxdb url not set in yardstick.conf')
- raise
+ influx_conf = utils.parse_ini_file(consts.CONF_FILE).get('dispatcher_influxdb', {})
data = {
"name": "yardstick",
"type": "influxdb",
"access": "proxy",
- "url": influx_url,
- "password": "root",
- "user": "root",
+ "url": influx_conf.get('target', ''),
+ "password": influx_conf.get('password', ''),
+ "user": influx_conf.get('username', ''),
"database": "yardstick",
"basicAuth": True,
"basicAuthUser": "admin",