diff --git a/etc/nova/nova-config-generator.conf b/etc/nova/nova-config-generator.conf index c11a4153df63..2597e0c9cf27 100644 --- a/etc/nova/nova-config-generator.conf +++ b/etc/nova/nova-config-generator.conf @@ -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 diff --git a/nova/api/openstack/compute/volumes.py b/nova/api/openstack/compute/volumes.py index aa7cf386cb6c..84c9e78fea44 100644 --- a/nova/api/openstack/compute/volumes.py +++ b/nova/api/openstack/compute/volumes.py @@ -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) diff --git a/nova/compute/api.py b/nova/compute/api.py index 85b93323989a..0cef59364150 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -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() diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 189a1fed9b2f..6115af6f205d 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -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 diff --git a/nova/opts.py b/nova/opts.py deleted file mode 100644 index 042091818995..000000000000 --- a/nova/opts.py +++ /dev/null @@ -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, - )), - ] diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index 9b7b99ffeb39..a9691a9aa037 100644 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -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 = { diff --git a/nova/volume/__init__.py b/nova/volume/__init__.py index b57e84387954..e69de29bb2d1 100644 --- a/nova/volume/__init__.py +++ b/nova/volume/__init__.py @@ -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() diff --git a/releasenotes/notes/remove_volume_api_class-a3c618228c89f57b.yaml b/releasenotes/notes/remove_volume_api_class-a3c618228c89f57b.yaml new file mode 100644 index 000000000000..2a9367c4c4b8 --- /dev/null +++ b/releasenotes/notes/remove_volume_api_class-a3c618228c89f57b.yaml @@ -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.