summaryrefslogtreecommitdiff
path: root/nova/keymgr
diff options
context:
space:
mode:
authorKevin_Zheng <zhengzhenyu@huawei.com>2016-01-29 14:12:50 +0800
committerKevin_Zheng <zhengzhenyu@huawei.com>2016-03-29 23:47:50 +0800
commit8b0b54bd4690f6bb63747b7e4fae02bfbaa69b84 (patch)
treed65bf10e14f08c890617108337bc15f953782a8f /nova/keymgr
parentce018ecceab3e6101af7b1e1504c50716860cebd (diff)
downloadnova-8b0b54bd4690f6bb63747b7e4fae02bfbaa69b84.tar.gz
config options: centralize section: "keymgr"
The config options of the "nova.conf" section "keymgr" and "barbican" got moved to the new central location "nova/conf/keymgr.py" Change-Id: I018c3a408a8903be8d006760994de6947fb91168 Implements: blueprint centralize-config-options-newton
Diffstat (limited to 'nova/keymgr')
-rw-r--r--nova/keymgr/__init__.py11
-rw-r--r--nova/keymgr/barbican.py25
-rw-r--r--nova/keymgr/conf_key_mgr.py10
3 files changed, 8 insertions, 38 deletions
diff --git a/nova/keymgr/__init__.py b/nova/keymgr/__init__.py
index 79880b4d70..5e10b395b7 100644
--- a/nova/keymgr/__init__.py
+++ b/nova/keymgr/__init__.py
@@ -14,18 +14,11 @@
# under the License.
-from oslo_config import cfg
from oslo_utils import importutils
+import nova.conf
-keymgr_opts = [
- cfg.StrOpt('api_class',
- default='nova.keymgr.conf_key_mgr.ConfKeyManager',
- help='The full class name of the key manager API class'),
-]
-
-CONF = cfg.CONF
-CONF.register_opts(keymgr_opts, group='keymgr')
+CONF = nova.conf.CONF
def API():
diff --git a/nova/keymgr/barbican.py b/nova/keymgr/barbican.py
index 99bd76eab8..50faf8ea29 100644
--- a/nova/keymgr/barbican.py
+++ b/nova/keymgr/barbican.py
@@ -24,36 +24,19 @@ import binascii
from barbicanclient import client as barbican_client
from keystoneauth1 import loading as ks_loading
from keystoneauth1 import session
-from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import excutils
+import nova.conf
+
from nova import exception
from nova.i18n import _
from nova.i18n import _LE
from nova.keymgr import key as keymgr_key
from nova.keymgr import key_mgr
-barbican_opts = [
- cfg.StrOpt('catalog_info',
- default='key-manager:barbican:public',
- help='Info to match when looking for barbican in the service '
- 'catalog. Format is: separated values of the form: '
- '<service_type>:<service_name>:<endpoint_type>'),
- cfg.StrOpt('endpoint_template',
- help='Override service catalog lookup with template for '
- 'barbican endpoint e.g. '
- 'http://localhost:9311/v1/%(project_id)s'),
- cfg.StrOpt('os_region_name',
- help='Region name of this node'),
-]
-
-CONF = cfg.CONF
-BARBICAN_OPT_GROUP = 'barbican'
-
-CONF.register_opts(barbican_opts, group=BARBICAN_OPT_GROUP)
-ks_loading.register_session_conf_options(CONF, BARBICAN_OPT_GROUP)
+CONF = nova.conf.CONF
LOG = logging.getLogger(__name__)
@@ -92,7 +75,7 @@ class BarbicanKeyManager(key_mgr.KeyManager):
try:
_SESSION = ks_loading.load_session_from_conf_options(
CONF,
- BARBICAN_OPT_GROUP)
+ nova.conf.barbican.barbican_group)
auth = ctxt.get_auth_plugin()
service_type, service_name, interface = (CONF.
diff --git a/nova/keymgr/conf_key_mgr.py b/nova/keymgr/conf_key_mgr.py
index fac967429f..1e0a1ce14e 100644
--- a/nova/keymgr/conf_key_mgr.py
+++ b/nova/keymgr/conf_key_mgr.py
@@ -31,18 +31,12 @@ encrypted with a key provided by this key manager actually share the same
encryption key so *any* volume can be decrypted once the fixed key is known.
"""
-from oslo_config import cfg
-
+import nova.conf
from nova.i18n import _
from nova.keymgr import single_key_mgr
-key_mgr_opts = [
- cfg.StrOpt('fixed_key',
- help='Fixed key returned by key manager, specified in hex'),
-]
-CONF = cfg.CONF
-CONF.register_opts(key_mgr_opts, group='keymgr')
+CONF = nova.conf.CONF
class ConfKeyManager(single_key_mgr.SingleKeyManager):