summaryrefslogtreecommitdiff
path: root/nova/keymgr
diff options
context:
space:
mode:
authorKaitlin Farr <kaitlin.farr@jhuapl.edu>2017-03-01 15:15:29 -0500
committerKaitlin Farr <kaitlin.farr@jhuapl.edu>2017-09-11 15:48:30 -0400
commitf65d436c114bbfc2051c6f5b6d7a9d12daacc29d (patch)
tree4fe3e34a9cae7ba0395a835c2ef719c96bdc936b /nova/keymgr
parentd83e9c0b177d63c425075438c1462cdd809baa93 (diff)
downloadnova-f65d436c114bbfc2051c6f5b6d7a9d12daacc29d.tar.gz
Remove deprecated keymgr code
Now that enough time has passed, the keymgr code that was deprecated for removal can be removed. Barbican is the default option for Castellan, but Barbican is not part of default DevStack yet. Until Barbican is used by default in the dsvm gates, ConfKeyManager (the fixed_key key manager) should be set in DevStack, which was added with I733279864ee1a4aaffc9c8eed81b5e12f8d8821b. Change-Id: I82ee74f3d2629281dc8116af55f6a7b5398fc473
Diffstat (limited to 'nova/keymgr')
-rw-r--r--nova/keymgr/__init__.py69
1 files changed, 0 insertions, 69 deletions
diff --git a/nova/keymgr/__init__.py b/nova/keymgr/__init__.py
index 0d4f1a37ac..e69de29bb2 100644
--- a/nova/keymgr/__init__.py
+++ b/nova/keymgr/__init__.py
@@ -1,69 +0,0 @@
-# Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-
-from oslo_config import cfg
-from oslo_log import log as logging
-from oslo_utils import importutils
-
-import nova.conf
-
-LOG = logging.getLogger(__name__)
-CONF = nova.conf.CONF
-
-# NOTE(kfarr): For backwards compatibility, everything below this comment
-# is deprecated for removal
-api_class = None
-try:
- api_class = CONF.key_manager.api_class
-except cfg.NoSuchOptError:
- LOG.warning("key_manager.api_class is not set, will use deprecated "
- "option keymgr.api_class if set")
- try:
- api_class = CONF.keymgr.api_class
- except cfg.NoSuchOptError:
- LOG.warning("keymgr.api_class is not set")
-
-deprecated_barbican = 'nova.keymgr.barbican.BarbicanKeyManager'
-barbican = 'castellan.key_manager.barbican_key_manager.BarbicanKeyManager'
-deprecated_mock = 'nova.tests.unit.keymgr.mock_key_mgr.MockKeyManager'
-castellan_mock = ('castellan.tests.unit.key_manager.mock_key_manager.'
- 'MockKeyManager')
-
-
-def log_deprecated_warning(deprecated, castellan):
- LOG.warning("key manager api_class set to use deprecated option "
- "%(deprecated)s, using %(castellan)s instead",
- {'deprecated': deprecated, 'castellan': castellan})
-
-if api_class == deprecated_barbican:
- log_deprecated_warning(deprecated_barbican, barbican)
- api_class = barbican
-elif api_class == deprecated_mock:
- log_deprecated_warning(deprecated_mock, castellan_mock)
- api_class = castellan_mock
-elif api_class is None:
- # TODO(kfarr): key_manager.api_class should be set in DevStack, and this
- # block can be removed
- LOG.warning("key manager not set, using insecure default %s",
- castellan_mock)
- api_class = castellan_mock
-
-CONF.set_override('api_class', api_class, 'key_manager')
-
-
-def API(conf=CONF):
- cls = importutils.import_class(CONF.key_manager.api_class)
- return cls(conf)