Remove deprecated config option volume_api_class

UpgradeImpact: Config option volume_api_class was deprecated in 13.0.0,
We can remove it in 14.0.0.

This commit also removes namespace 'nova' in file
nova-config-generator.conf.

Change-Id: I7841b016703a9cb5c0e783fe81a5cdcd7f4af9c5
This commit is contained in:
ChangBo Guo(gcb) 2016-05-21 14:27:22 +08:00
parent eec3a2b9e8
commit 6af8d2c8e9
8 changed files with 15 additions and 80 deletions

View File

@ -1,7 +1,6 @@
[DEFAULT]
output_file = etc/nova/nova.conf.sample
wrap_width = 80
namespace = nova
namespace = nova.conf
namespace = nova.api
namespace = nova.cells

View File

@ -31,7 +31,7 @@ from nova.i18n import _
from nova import objects
from nova.policies import volumes as vol_policies
from nova.policies import volumes_attachments as va_policies
from nova import volume
from nova.volume import cinder
ALIAS = "os-volumes"
@ -97,7 +97,7 @@ class VolumeController(wsgi.Controller):
"""The Volumes API controller for the OpenStack API."""
def __init__(self):
self.volume_api = volume.API()
self.volume_api = cinder.API()
super(VolumeController, self).__init__()
@extensions.expected_errors(404)
@ -249,7 +249,7 @@ class VolumeAttachmentController(wsgi.Controller):
def __init__(self):
self.compute_api = compute.API()
self.volume_api = volume.API()
self.volume_api = cinder.API()
super(VolumeAttachmentController, self).__init__()
@extensions.expected_errors(404)
@ -501,7 +501,7 @@ class SnapshotController(wsgi.Controller):
"""The Snapshots API controller for the OpenStack API."""
def __init__(self):
self.volume_api = volume.API()
self.volume_api = cinder.API()
super(SnapshotController, self).__init__()
@extensions.expected_errors(404)

View File

@ -81,7 +81,7 @@ from nova.scheduler import utils as scheduler_utils
from nova import servicegroup
from nova import utils
from nova.virt import hardware
from nova import volume
from nova.volume import cinder
LOG = logging.getLogger(__name__)
@ -197,7 +197,7 @@ class API(base.Base):
security_group_api=None, **kwargs):
self.image_api = image_api or image.API()
self.network_api = network_api or network.API()
self.volume_api = volume_api or volume.API()
self.volume_api = volume_api or cinder.API()
self.security_group_api = (security_group_api or
openstack_driver.get_openstack_security_group_driver())
self.consoleauth_rpcapi = consoleauth_rpcapi.ConsoleAuthAPI()

View File

@ -98,7 +98,7 @@ from nova.virt import driver
from nova.virt import event as virtevent
from nova.virt import storage_users
from nova.virt import virtapi
from nova import volume
from nova.volume import cinder
from nova.volume import encryptors
CONF = nova.conf.CONF
@ -494,7 +494,7 @@ class ComputeManager(manager.Manager):
"""Load configuration options and connect to the hypervisor."""
self.virtapi = ComputeVirtAPI(self)
self.network_api = network.API()
self.volume_api = volume.API()
self.volume_api = cinder.API()
self.image_api = image.API()
self._last_host_check = 0
self._last_bw_usage_poll = 0

View File

@ -1,35 +0,0 @@
# 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.
import itertools
import nova.baserpc
import nova.cloudpipe.pipelib
import nova.cmd.serialproxy
import nova.cmd.spicehtml5proxy
import nova.conductor.rpcapi
import nova.conf
import nova.console.rpcapi
import nova.console.serial
import nova.consoleauth.rpcapi
import nova.exception
import nova.image.download.file
import nova.volume
def list_opts():
return [
('DEFAULT',
itertools.chain(
nova.volume._volume_opts,
)),
]

View File

@ -111,7 +111,7 @@ from nova.virt.libvirt import vif as libvirt_vif
from nova.virt.libvirt.volume import remotefs
from nova.virt import netutils
from nova.virt import watchdog_actions
from nova import volume
from nova.volume import cinder
from nova.volume import encryptors
libvirt = None
@ -378,7 +378,7 @@ class LibvirtDriver(driver.ComputeDriver):
continue
self.disk_cachemodes[disk_type] = cache_mode
self._volume_api = volume.API()
self._volume_api = cinder.API()
self._image_api = image.API()
sysinfo_serial_funcs = {

View File

@ -1,34 +0,0 @@
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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.
import oslo_config.cfg
from oslo_utils import importutils
_volume_opts = [
oslo_config.cfg.StrOpt(
'volume_api_class',
default='nova.volume.cinder.API',
help='DEPRECATED: The full class name of the volume API class to use',
deprecated_for_removal=True)
]
oslo_config.cfg.CONF.register_opts(_volume_opts)
def API():
volume_api_class = oslo_config.cfg.CONF.volume_api_class
cls = importutils.import_class(volume_api_class)
return cls()

View File

@ -0,0 +1,5 @@
---
upgrade:
- The deprecated ``volume_api_class`` config option has been
removed. We only have one sensible backend for it, so
don't need it anymore.