diff options
author | chenjiankun <chenjiankun1@huawei.com> | 2016-12-15 02:31:43 +0000 |
---|---|---|
committer | chenjiankun <chenjiankun1@huawei.com> | 2016-12-26 17:40:50 +0000 |
commit | 2e555046e2d2b7fba80df1082e9cdccb315df86e (patch) | |
tree | 81f80ab5fd394abf91ed681c86313715a08bf5b9 /yardstick/common | |
parent | bd847993c084f2d29de099c4b0e33a3d2e8de03e (diff) |
Use ConfigParser to write yardstick.conf
JIRA: YARDSTICK-474
Currently, I use file.write() method to write config in yardstick.conf.
But it is not recommended.
So I change to use ConfigParser to write config in yardstick.conf
Change-Id: Ia789cf09296afd5d1507bcf99f165378bf87c591
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
Diffstat (limited to 'yardstick/common')
-rw-r--r-- | yardstick/common/constants.py | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/yardstick/common/constants.py b/yardstick/common/constants.py index 6993c41b9..705e1ad87 100644 --- a/yardstick/common/constants.py +++ b/yardstick/common/constants.py @@ -1,3 +1,11 @@ +############################################################################## +# Copyright (c) 2016 Huawei Technologies Co.,Ltd and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## import os DOCKER_URL = 'unix://var/run/docker.sock' @@ -15,6 +23,7 @@ GRAFANA_TAGS = '3.1.1' dirname = os.path.dirname abspath = os.path.abspath +join = os.path.join sep = os.path.sep INSTALLERS = ['apex', 'compass', 'fuel', 'joid'] @@ -25,7 +34,12 @@ YARDSTICK_REPOS_DIR = '/home/opnfv/repos/yardstick' YARDSTICK_CONFIG_DIR = '/etc/yardstick/' -YARDSTICK_CONFIG_FILE = os.path.join(YARDSTICK_CONFIG_DIR, 'yardstick.conf') +YARDSTICK_CONFIG_FILE = join(YARDSTICK_CONFIG_DIR, 'yardstick.conf') + +YARDSTICK_CONFIG_SAMPLE_DIR = join(YARDSTICK_ROOT_PATH, 'etc/yardstick/') + +YARDSTICK_CONFIG_SAMPLE_FILE = join(YARDSTICK_CONFIG_SAMPLE_DIR, + 'yardstick.conf.sample') RELENG_DIR = '/home/opnfv/repos/releng' @@ -35,6 +49,6 @@ CLEAN_IMAGES_SCRIPT = 'tests/ci/clean_images.sh' LOAD_IMAGES_SCRIPT = 'tests/ci/load_images.sh' -OPENSTACK_RC_FILE = os.path.join(YARDSTICK_CONFIG_DIR, 'openstack.creds') +OPENSTACK_RC_FILE = join(YARDSTICK_CONFIG_DIR, 'openstack.creds') YARDSTICK_ENV_ACTION_API = 'http://localhost:5000/yardstick/env/action' |