aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/common
diff options
context:
space:
mode:
authorchenjiankun <chenjiankun1@huawei.com>2017-07-14 08:26:53 +0000
committerchenjiankun <chenjiankun1@huawei.com>2017-07-14 08:58:05 +0000
commitcce6fa7f1bca039bedc7484aff6f7862d9074053 (patch)
treec82b60efeaebc372cb7c3accd1f7eef57fc15113 /yardstick/common
parent961de9447288c431a47a42a31a70df23ccc726eb (diff)
yardstick env influxdb/grafana cmd support centos
JIRA: YARDSTICK-714 Currently yardstick env influxdb/grafana command do not support centos. Because we use the gateway ip to get the service of influxdb and grafana. But in centos, we can not access influxdb/grafana service via gateway ip. In this patch, I use docker inspect to get the ip of influxdb and grafana. So these command can support centos. Change-Id: I4599cbbd0fe43de9cf08e5d9e74d31edbb742998 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
Diffstat (limited to 'yardstick/common')
-rw-r--r--yardstick/common/constants.py2
-rw-r--r--yardstick/common/utils.py9
2 files changed, 10 insertions, 1 deletions
diff --git a/yardstick/common/constants.py b/yardstick/common/constants.py
index cb98c356d..631cf81ba 100644
--- a/yardstick/common/constants.py
+++ b/yardstick/common/constants.py
@@ -63,6 +63,7 @@ INFLUXDB_PASS = get_param('influxdb.password', 'root')
INFLUXDB_DB_NAME = get_param('influxdb.db_name', 'yardstick')
INFLUXDB_IMAGE = get_param('influxdb.image', 'tutum/influxdb')
INFLUXDB_TAG = get_param('influxdb.tag', '0.13')
+INFLUXDB_DASHBOARD_PORT = 8083
# grafana
GRAFANA_IP = get_param('grafana.ip', SERVER_IP)
@@ -71,6 +72,7 @@ GRAFANA_USER = get_param('grafana.username', 'admin')
GRAFANA_PASS = get_param('grafana.password', 'admin')
GRAFANA_IMAGE = get_param('grafana.image', 'grafana/grafana')
GRAFANA_TAG = get_param('grafana.tag', '3.1.1')
+GRAFANA_MAPPING_PORT = 1948
# api
DOCKER_URL = 'unix://var/run/docker.sock'
diff --git a/yardstick/common/utils.py b/yardstick/common/utils.py
index 7035f3374..1d7359f0e 100644
--- a/yardstick/common/utils.py
+++ b/yardstick/common/utils.py
@@ -155,7 +155,14 @@ def write_file(path, data, mode='w'):
def parse_ini_file(path):
parser = configparser.ConfigParser()
- parser.read(path)
+ try:
+ files = parser.read(path)
+ except configparser.MissingSectionHeaderError:
+ logger.exception('invalid file type')
+ raise
+ else:
+ if not files:
+ raise RuntimeError('file not exist')
try:
default = {k: v for k, v in parser.items('DEFAULT')}