diff options
author | 2015-09-29 14:50:12 +0800 | |
---|---|---|
committer | 2015-10-15 01:17:39 +0000 | |
commit | cd809cb6b8bd4bd5002538d107aea1fb8adb0584 (patch) | |
tree | 65b5b96f3f51628f519415e82c6b103fadff700a /yardstick/dispatcher/__init__.py | |
parent | a1378b700a9234e7fcbf77c7890030b306bc65ea (diff) |
Support general configuration file
Use openstack library oslo_config for parsing configuration options
from the command line and configuration files.
Refer http://docs.openstack.org/developer/oslo.config/ or rally
source code for more info on oslo_config library usage.
This patch is initially for test result dispatcher configuration,
but it is very general to use.
Usage:
0) install yardstick
1) mkdir /etc/yardstick
2) cp <repo_root_dir>/etc/yardstick/yardstick.conf.sample \
/etc/yardstick/yardstick.conf
3) edit /etc/yardstick/yardstick.conf
4) run `yardstick task start xxx` cmd
JIRA: YARDSTICK-61
Change-Id: I01677ef6e9ab7c1975aa193799195e850da73478
Signed-off-by: QiLiang <liangqi1@huawei.com>
Diffstat (limited to 'yardstick/dispatcher/__init__.py')
-rw-r--r-- | yardstick/dispatcher/__init__.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/yardstick/dispatcher/__init__.py b/yardstick/dispatcher/__init__.py index 44278c1d2..b519efc7a 100644 --- a/yardstick/dispatcher/__init__.py +++ b/yardstick/dispatcher/__init__.py @@ -7,6 +7,16 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## +from oslo_config import cfg + import yardstick.common.utils as utils utils.import_modules_from_package("yardstick.dispatcher") + +CONF = cfg.CONF +OPTS = [ + cfg.StrOpt('dispatcher', + default='file', + help='Dispatcher to store data.'), +] +CONF.register_opts(OPTS) |