summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhi Yan Liu <zhiyanl@cn.ibm.com>2015-03-01 20:31:14 +0800
committerZhi Yan Liu <zhiyanl@cn.ibm.com>2015-03-11 20:40:02 +0800
commit2454639a601f3fb88cc413c50501dfec3aca3a65 (patch)
tree875fe4f53ad49959cafae6426aaca8f385641a98
parentb8d62633ec85871911c2d234c787857695233eb1 (diff)
downloadglance_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>
-rw-r--r--glance_store/_drivers/swift/store.py2
-rw-r--r--glance_store/_drivers/swift/utils.py2
-rw-r--r--glance_store/backend.py2
-rw-r--r--glance_store/driver.py2
-rw-r--r--glance_store/location.py2
5 files changed, 5 insertions, 5 deletions
diff --git a/glance_store/_drivers/swift/store.py b/glance_store/_drivers/swift/store.py
index 472f515..68b47a4 100644
--- a/glance_store/_drivers/swift/store.py
+++ b/glance_store/_drivers/swift/store.py
@@ -20,7 +20,7 @@ import httplib
import logging
import math
-from oslo.config import cfg
+from oslo_config import cfg
from oslo_utils import excutils
from oslo_utils import units
import six
diff --git a/glance_store/_drivers/swift/utils.py b/glance_store/_drivers/swift/utils.py
index 5565d5f..c27889e 100644
--- a/glance_store/_drivers/swift/utils.py
+++ b/glance_store/_drivers/swift/utils.py
@@ -20,7 +20,7 @@ try:
except ImportError:
from ordereddict import OrderedDict
-from oslo.config import cfg
+from oslo_config import cfg
from glance_store import exceptions
from glance_store import i18n
diff --git a/glance_store/backend.py b/glance_store/backend.py
index 735e603..66f7de7 100644
--- a/glance_store/backend.py
+++ b/glance_store/backend.py
@@ -15,7 +15,7 @@
import logging
-from oslo.config import cfg
+from oslo_config import cfg
from stevedore import driver
from stevedore import extension
diff --git a/glance_store/driver.py b/glance_store/driver.py
index 5599a75..34ecaac 100644
--- a/glance_store/driver.py
+++ b/glance_store/driver.py
@@ -18,7 +18,7 @@
import logging
-from oslo.config import cfg
+from oslo_config import cfg
from oslo_utils import importutils
from oslo_utils import units
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