From e14fbe5d144f2048409799ddc4f06f54764d97f7 Mon Sep 17 00:00:00 2001 From: wangzhh Date: Sun, 30 Jul 2017 13:12:00 -0400 Subject: [PATCH] Make some config options work 1.Seperate the etcd_group and glance_opt_group from [DEFAULT] 2.Change refrence CONF.common.xx to CONF.xx Change-Id: I0f95c063941e649ec92faf2328107925ee5e7e2b Closes-Bug: #1707506 --- zun/common/paths.py | 6 +++--- zun/conf/database.py | 5 +++-- zun/conf/image_driver.py | 5 +++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/zun/common/paths.py b/zun/common/paths.py index 9947d4efd..e71d609ae 100644 --- a/zun/common/paths.py +++ b/zun/common/paths.py @@ -34,14 +34,14 @@ def state_path_def(*args): def basedir_rel(*args): """Return a path relative to $pybasedir.""" - return os.path.join(CONF.common.pybasedir, *args) + return os.path.join(CONF.pybasedir, *args) def bindir_rel(*args): """Return a path relative to $bindir.""" - return os.path.join(CONF.common.bindir, *args) + return os.path.join(CONF.bindir, *args) def state_path_rel(*args): """Return a path relative to $state_path.""" - return os.path.join(CONF.common.state_path, *args) + return os.path.join(CONF.state_path, *args) diff --git a/zun/conf/database.py b/zun/conf/database.py index 1ebe610a5..fbcf80219 100644 --- a/zun/conf/database.py +++ b/zun/conf/database.py @@ -41,7 +41,8 @@ etcd_opts = [ etcd_group = cfg.OptGroup(name='etcd', title='Options for etcd connection') -ALL_OPTS = (db_opts + sql_opts + etcd_opts) +DEFAULT_OPTS = (db_opts + sql_opts) +ETCD_OPTS = (etcd_opts) def register_opts(conf): @@ -52,4 +53,4 @@ def register_opts(conf): def list_opts(): - return {"DEFAULT": ALL_OPTS} + return {"DEFAULT": DEFAULT_OPTS, etcd_group: ETCD_OPTS} diff --git a/zun/conf/image_driver.py b/zun/conf/image_driver.py index 725b0e85a..ae1710358 100644 --- a/zun/conf/image_driver.py +++ b/zun/conf/image_driver.py @@ -57,7 +57,8 @@ glance_driver_opts = [ glance_opt_group = cfg.OptGroup(name='glance', title='Glance options for image management') -ALL_OPTS = (glance_driver_opts + image_driver_opts + sandbox_opts) +DEFAULT_OPTS = (image_driver_opts + sandbox_opts) +GLANCE_OPTS = (glance_driver_opts) def register_opts(conf): @@ -68,4 +69,4 @@ def register_opts(conf): def list_opts(): - return {"DEFAULT": ALL_OPTS} + return {"DEFAULT": DEFAULT_OPTS, glance_opt_group: GLANCE_OPTS}