diff options
author | Zhi Yan Liu <zhiyanl@cn.ibm.com> | 2015-03-01 20:31:14 +0800 |
---|---|---|
committer | Zhi Yan Liu <zhiyanl@cn.ibm.com> | 2015-03-11 20:40:02 +0800 |
commit | 2454639a601f3fb88cc413c50501dfec3aca3a65 (patch) | |
tree | 875fe4f53ad49959cafae6426aaca8f385641a98 /glance_store/location.py | |
parent | b8d62633ec85871911c2d234c787857695233eb1 (diff) | |
download | glance_store-2454639a601f3fb88cc413c50501dfec3aca3a65.tar.gz |
Use oslo_config.cfg.ConfigOpts in glance_store
Move from oslo.config to oslo_config. This change could prevent glance
failed by "NoSuchOptError: no such option: glance_store" triggered in
verify_default_store() error when startup [0].
The root cause is that when we import oslo.config.cfg (when importing
glance_store in glance context) first than oslo_config.cfg, global
oslo.config.cfg.ConfigOpts object (CONF) in glance_store code is a
different object (and type) than oslo_config.cfg.ConfigOpts object in
glance code, so register_opts() of glance_store registered all store
needed options to a separated ConfigOpts object but glance used one.
With change I30ecbf8f9de77496fcb643c7ad9738d79ad359f0) glance is using
oslo_config namespace now, so before release new glance_store, we need
merge this change in.
A clear and simpler example as following:
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
>>> from glance_store import backend
>>> from glance.common import config # we do this importing order for
pep8 required in now code.
>>> config.CONF == backend.CONF, config.CONF, backend.CONF
(False, <oslo_config.cfg.ConfigOpts object at 0x7f4e4cd18690>,
<oslo.config.cfg.ConfigOpts object at 0x7f4e4e521d50>)
# Renew python session.
>>> from glance.common import config
>>> from glance_store import backend
>>> config.CONF == backend.CONF, config.CONF, backend.CONF
(True, <oslo_config.cfg.ConfigOpts object at 0x7fc355937450>,
<oslo_config.cfg.ConfigOpts object at 0x7fc355937450>)
Change-Id: I1f1962c462b0c1fcdce0c04c6a1cec57d9f191eb
Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
Diffstat (limited to 'glance_store/location.py')
-rw-r--r-- | glance_store/location.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/glance_store/location.py b/glance_store/location.py index a98773d..b60c485 100644 --- a/glance_store/location.py +++ b/glance_store/location.py @@ -40,7 +40,7 @@ credentials and is **not** user-facing. import logging import urlparse -from oslo.config import cfg +from oslo_config import cfg from glance_store import exceptions |