diff --git a/nova/api/openstack/compute/legacy_v2/contrib/__init__.py b/nova/api/openstack/compute/legacy_v2/contrib/__init__.py index a59ffe8e9eb5..a51bb9232d03 100644 --- a/nova/api/openstack/compute/legacy_v2/contrib/__init__.py +++ b/nova/api/openstack/compute/legacy_v2/contrib/__init__.py @@ -19,24 +19,12 @@ It can't be called 'extensions' because that causes namespacing problems. """ -from oslo_config import cfg from oslo_log import log as logging from nova.api.openstack import extensions +import nova.conf -ext_opts = [ - cfg.ListOpt('osapi_compute_ext_list', - default=[], - help='DEPRECATED: Specify list of extensions to load when ' - 'using osapi_compute_extension option with nova.api.' - 'openstack.compute.legacy_v2.contrib.select_extensions ' - 'This option will be removed in the near future. ' - 'After that point you have to run all of the API.', - deprecated_for_removal=True), -] -CONF = cfg.CONF -CONF.register_opts(ext_opts) - +CONF = nova.conf.CONF LOG = logging.getLogger(__name__) diff --git a/nova/api/openstack/compute/legacy_v2/extensions.py b/nova/api/openstack/compute/legacy_v2/extensions.py index af030a0307fd..68839cce912b 100644 --- a/nova/api/openstack/compute/legacy_v2/extensions.py +++ b/nova/api/openstack/compute/legacy_v2/extensions.py @@ -13,27 +13,16 @@ # 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 nova.api.openstack import extensions as base_extensions +import nova.conf from nova.i18n import _LW STANDARD_EXTENSIONS = ('nova.api.openstack.compute.legacy_v2.contrib.' + 'standard_extensions') -ext_opts = [ - cfg.MultiStrOpt( - 'osapi_compute_extension', - default=[STANDARD_EXTENSIONS], - help='osapi compute extension to load. ' - 'This option will be removed in the near future. ' - 'After that point you have to run all of the API.', - deprecated_for_removal=True), -] -CONF = cfg.CONF -CONF.register_opts(ext_opts) - +CONF = nova.conf.CONF LOG = logging.getLogger(__name__) diff --git a/nova/api/opts.py b/nova/api/opts.py deleted file mode 100644 index 7194e3072fe6..000000000000 --- a/nova/api/opts.py +++ /dev/null @@ -1,26 +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.api.openstack.compute.legacy_v2.contrib -import nova.api.openstack.compute.legacy_v2.extensions - - -def list_opts(): - return [ - ('DEFAULT', - itertools.chain( - nova.api.openstack.compute.legacy_v2.contrib.ext_opts, - nova.api.openstack.compute.legacy_v2.extensions.ext_opts, - )), - ] diff --git a/nova/conf/__init__.py b/nova/conf/__init__.py index 943f9e72bf6d..506cb9e7af05 100644 --- a/nova/conf/__init__.py +++ b/nova/conf/__init__.py @@ -53,7 +53,7 @@ from nova.conf import ipv6 from nova.conf import ironic from nova.conf import key_manager # from nova.conf import keystone_authtoken -# from nova.conf import legacy_api +from nova.conf import legacy_api from nova.conf import libvirt from nova.conf import mks # from nova.conf import matchmaker_redis @@ -128,7 +128,7 @@ ipv6.register_opts(CONF) ironic.register_opts(CONF) key_manager.register_opts(CONF) # keystone_authtoken.register_opts(CONF) -# legacy_api.register_opts(CONF) +legacy_api.register_opts(CONF) libvirt.register_opts(CONF) # matchmaker_redis.register_opts(CONF) # metadata.register_opts(CONF) diff --git a/nova/conf/legacy_api.py b/nova/conf/legacy_api.py new file mode 100644 index 000000000000..1a25a3b462c7 --- /dev/null +++ b/nova/conf/legacy_api.py @@ -0,0 +1,47 @@ +# Copyright 2015 OpenStack Foundation +# 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 + +STANDARD_EXTENSIONS = ('nova.api.openstack.compute.legacy_v2.contrib.' + + 'standard_extensions') + +osapi_ext_list_opt = cfg.ListOpt('osapi_compute_ext_list', + default=[], + help='DEPRECATED: Specify list of extensions to load when ' + 'using osapi_compute_extension option with nova.api.' + 'openstack.compute.legacy_v2.contrib.select_extensions ' + 'This option will be removed in the near future. ' + 'After that point you have to run all of the API.', + deprecated_for_removal=True) + +osapi_comp_ext_opt = cfg.MultiStrOpt( + 'osapi_compute_extension', + default=[STANDARD_EXTENSIONS], + help='The osapi compute extension to load. ' + 'This option will be removed in the near future. ' + 'After that point you have to run all of the API.', + deprecated_for_removal=True) + +ALL_OPTS = [osapi_ext_list_opt] + [osapi_comp_ext_opt] + + +def register_opts(conf): + conf.register_opt(osapi_ext_list_opt) + conf.register_opt(osapi_comp_ext_opt) + + +def list_opts(): + return {"DEFAULT": ALL_OPTS} diff --git a/nova/tests/functional/api_sample_tests/api_sample_base.py b/nova/tests/functional/api_sample_tests/api_sample_base.py index 29a7dd296931..000bb9b3f2b8 100644 --- a/nova/tests/functional/api_sample_tests/api_sample_base.py +++ b/nova/tests/functional/api_sample_tests/api_sample_base.py @@ -25,8 +25,6 @@ from nova.tests.unit import fake_network from nova.tests.unit import fake_utils CONF = nova.conf.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') # API samples heavily uses testscenarios. This allows us to use the # same tests, with slight variations in configuration to ensure our diff --git a/nova/tests/functional/api_sample_tests/test_access_ips.py b/nova/tests/functional/api_sample_tests/test_access_ips.py index d89fa63f55d3..a07a4d68f24c 100644 --- a/nova/tests/functional/api_sample_tests/test_access_ips.py +++ b/nova/tests/functional/api_sample_tests/test_access_ips.py @@ -13,14 +13,11 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import api_sample_base from nova.tests.unit.image import fake -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class AccessIPsSampleJsonTest(api_sample_base.ApiSampleTestBaseV21): diff --git a/nova/tests/functional/api_sample_tests/test_admin_actions.py b/nova/tests/functional/api_sample_tests/test_admin_actions.py index 225300f207b8..ac157b15f17e 100644 --- a/nova/tests/functional/api_sample_tests/test_admin_actions.py +++ b/nova/tests/functional/api_sample_tests/test_admin_actions.py @@ -13,13 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import test_servers -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class AdminActionsSamplesJsonTest(test_servers.ServersSampleBase): diff --git a/nova/tests/functional/api_sample_tests/test_admin_password.py b/nova/tests/functional/api_sample_tests/test_admin_password.py index 9b23c88d2a96..e86408666a66 100644 --- a/nova/tests/functional/api_sample_tests/test_admin_password.py +++ b/nova/tests/functional/api_sample_tests/test_admin_password.py @@ -13,13 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import test_servers -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class AdminPasswordJsonTest(test_servers.ServersSampleBase): diff --git a/nova/tests/functional/api_sample_tests/test_agents.py b/nova/tests/functional/api_sample_tests/test_agents.py index ffec5703056d..c89bb9975a39 100644 --- a/nova/tests/functional/api_sample_tests/test_agents.py +++ b/nova/tests/functional/api_sample_tests/test_agents.py @@ -13,14 +13,11 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.db.sqlalchemy import models from nova.tests.functional.api_sample_tests import api_sample_base -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class AgentsJsonTest(api_sample_base.ApiSampleTestBaseV21): diff --git a/nova/tests/functional/api_sample_tests/test_aggregates.py b/nova/tests/functional/api_sample_tests/test_aggregates.py index 079183851138..da3d0de563ce 100644 --- a/nova/tests/functional/api_sample_tests/test_aggregates.py +++ b/nova/tests/functional/api_sample_tests/test_aggregates.py @@ -13,13 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import api_sample_base -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class AggregatesSampleJsonTest(api_sample_base.ApiSampleTestBaseV21): diff --git a/nova/tests/functional/api_sample_tests/test_assisted_volume_snapshots.py b/nova/tests/functional/api_sample_tests/test_assisted_volume_snapshots.py index 38d9a44c0668..178432bc27cf 100644 --- a/nova/tests/functional/api_sample_tests/test_assisted_volume_snapshots.py +++ b/nova/tests/functional/api_sample_tests/test_assisted_volume_snapshots.py @@ -12,14 +12,11 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import test_servers from nova.tests.unit.api.openstack import fakes -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class AssistedVolumeSnapshotsJsonTests(test_servers.ServersSampleBase): diff --git a/nova/tests/functional/api_sample_tests/test_attach_interfaces.py b/nova/tests/functional/api_sample_tests/test_attach_interfaces.py index fe4d3576e976..f30fe6be96fb 100644 --- a/nova/tests/functional/api_sample_tests/test_attach_interfaces.py +++ b/nova/tests/functional/api_sample_tests/test_attach_interfaces.py @@ -13,16 +13,13 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova import exception from nova.network import api as network_api from nova.tests.functional.api_sample_tests import test_servers from nova.tests.unit import fake_network_cache_model -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class AttachInterfacesSampleJsonTest(test_servers.ServersSampleBase): diff --git a/nova/tests/functional/api_sample_tests/test_availability_zone.py b/nova/tests/functional/api_sample_tests/test_availability_zone.py index 0c95ee57660c..6bee7e116544 100644 --- a/nova/tests/functional/api_sample_tests/test_availability_zone.py +++ b/nova/tests/functional/api_sample_tests/test_availability_zone.py @@ -16,8 +16,6 @@ import nova.conf from nova.tests.functional.api_sample_tests import test_servers CONF = nova.conf.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') class AvailabilityZoneJsonTest(test_servers.ServersSampleBase): diff --git a/nova/tests/functional/api_sample_tests/test_baremetal_nodes.py b/nova/tests/functional/api_sample_tests/test_baremetal_nodes.py index 859aca22ab43..536e62991a92 100644 --- a/nova/tests/functional/api_sample_tests/test_baremetal_nodes.py +++ b/nova/tests/functional/api_sample_tests/test_baremetal_nodes.py @@ -14,13 +14,10 @@ import mock -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import api_sample_base -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class FakeNode(object): diff --git a/nova/tests/functional/api_sample_tests/test_block_device_mapping_boot.py b/nova/tests/functional/api_sample_tests/test_block_device_mapping_boot.py index 36e6e5188d5f..e21048e22fcc 100644 --- a/nova/tests/functional/api_sample_tests/test_block_device_mapping_boot.py +++ b/nova/tests/functional/api_sample_tests/test_block_device_mapping_boot.py @@ -13,14 +13,11 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import test_servers from nova.tests.unit.api.openstack import fakes -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class BlockDeviceMappingV1BootJsonTest(test_servers.ServersSampleBase): diff --git a/nova/tests/functional/api_sample_tests/test_cells.py b/nova/tests/functional/api_sample_tests/test_cells.py index e149b2986482..e1a8e1ff693d 100644 --- a/nova/tests/functional/api_sample_tests/test_cells.py +++ b/nova/tests/functional/api_sample_tests/test_cells.py @@ -23,8 +23,6 @@ from nova import exception from nova.tests.functional.api_sample_tests import api_sample_base CONF = nova.conf.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') class CellsSampleJsonTest(api_sample_base.ApiSampleTestBaseV21): diff --git a/nova/tests/functional/api_sample_tests/test_certificates.py b/nova/tests/functional/api_sample_tests/test_certificates.py index aa94f0632b3a..24d34b051bf7 100644 --- a/nova/tests/functional/api_sample_tests/test_certificates.py +++ b/nova/tests/functional/api_sample_tests/test_certificates.py @@ -13,14 +13,11 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import api_sample_base from nova.tests.unit import fake_crypto -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class CertificatesSamplesJsonTest(api_sample_base.ApiSampleTestBaseV21): diff --git a/nova/tests/functional/api_sample_tests/test_cloudpipe.py b/nova/tests/functional/api_sample_tests/test_cloudpipe.py index 481d89bd7986..7f56fd052c40 100644 --- a/nova/tests/functional/api_sample_tests/test_cloudpipe.py +++ b/nova/tests/functional/api_sample_tests/test_cloudpipe.py @@ -14,16 +14,13 @@ import uuid as uuid_lib -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import api_sample_base from nova.tests.unit.image import fake -CONF = cfg.CONF +CONF = nova.conf.CONF CONF.import_opt('vpn_image_id', 'nova.cloudpipe.pipelib') -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') class CloudPipeSampleTest(api_sample_base.ApiSampleTestBaseV21): diff --git a/nova/tests/functional/api_sample_tests/test_config_drive.py b/nova/tests/functional/api_sample_tests/test_config_drive.py index 18901bbb7693..987b9941edab 100644 --- a/nova/tests/functional/api_sample_tests/test_config_drive.py +++ b/nova/tests/functional/api_sample_tests/test_config_drive.py @@ -13,15 +13,12 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import test_servers from nova.tests.unit.api.openstack import fakes from nova.tests.unit.image import fake -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class ConfigDriveSampleJsonTest(test_servers.ServersSampleBase): diff --git a/nova/tests/functional/api_sample_tests/test_console_auth_tokens.py b/nova/tests/functional/api_sample_tests/test_console_auth_tokens.py index 448a23d6d2f0..35d9367960e8 100644 --- a/nova/tests/functional/api_sample_tests/test_console_auth_tokens.py +++ b/nova/tests/functional/api_sample_tests/test_console_auth_tokens.py @@ -14,14 +14,12 @@ import re -from oslo_config import cfg from oslo_serialization import jsonutils +import nova.conf from nova.tests.functional.api_sample_tests import test_servers -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class ConsoleAuthTokensSampleJsonTests(test_servers.ServersSampleBase): diff --git a/nova/tests/functional/api_sample_tests/test_console_output.py b/nova/tests/functional/api_sample_tests/test_console_output.py index 7d335cacc849..b10a942d70e5 100644 --- a/nova/tests/functional/api_sample_tests/test_console_output.py +++ b/nova/tests/functional/api_sample_tests/test_console_output.py @@ -13,13 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import test_servers -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class ConsoleOutputSampleJsonTest(test_servers.ServersSampleBase): diff --git a/nova/tests/functional/api_sample_tests/test_create_backup.py b/nova/tests/functional/api_sample_tests/test_create_backup.py index 97f2a6c59f10..2ee00de40d96 100644 --- a/nova/tests/functional/api_sample_tests/test_create_backup.py +++ b/nova/tests/functional/api_sample_tests/test_create_backup.py @@ -13,16 +13,13 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - import mock +import nova.conf from nova.tests.functional.api_sample_tests import test_servers from nova.tests.unit.image import fake -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class CreateBackupSamplesJsonTest(test_servers.ServersSampleBase): diff --git a/nova/tests/functional/api_sample_tests/test_deferred_delete.py b/nova/tests/functional/api_sample_tests/test_deferred_delete.py index 175061b28479..ca12495293a1 100644 --- a/nova/tests/functional/api_sample_tests/test_deferred_delete.py +++ b/nova/tests/functional/api_sample_tests/test_deferred_delete.py @@ -13,13 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import test_servers -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class DeferredDeleteSampleJsonTests(test_servers.ServersSampleBase): diff --git a/nova/tests/functional/api_sample_tests/test_disk_config.py b/nova/tests/functional/api_sample_tests/test_disk_config.py index c745e8b6a15e..d48e2011178c 100644 --- a/nova/tests/functional/api_sample_tests/test_disk_config.py +++ b/nova/tests/functional/api_sample_tests/test_disk_config.py @@ -13,14 +13,11 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import test_servers from nova.tests.unit.image import fake -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class DiskConfigJsonTest(test_servers.ServersSampleBase): diff --git a/nova/tests/functional/api_sample_tests/test_evacuate.py b/nova/tests/functional/api_sample_tests/test_evacuate.py index da8569ab68be..21ba5b5ff544 100644 --- a/nova/tests/functional/api_sample_tests/test_evacuate.py +++ b/nova/tests/functional/api_sample_tests/test_evacuate.py @@ -14,13 +14,11 @@ # under the License. import mock -from oslo_config import cfg +import nova.conf from nova.tests.functional.api_sample_tests import test_servers -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class EvacuateJsonTest(test_servers.ServersSampleBase): diff --git a/nova/tests/functional/api_sample_tests/test_extended_availability_zone.py b/nova/tests/functional/api_sample_tests/test_extended_availability_zone.py index 1e103be55782..653dc49ab601 100644 --- a/nova/tests/functional/api_sample_tests/test_extended_availability_zone.py +++ b/nova/tests/functional/api_sample_tests/test_extended_availability_zone.py @@ -13,13 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import test_servers -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class ExtendedAvailabilityZoneJsonTests(test_servers.ServersSampleBase): diff --git a/nova/tests/functional/api_sample_tests/test_extended_server_attributes.py b/nova/tests/functional/api_sample_tests/test_extended_server_attributes.py index a749c00a1101..a8c7f9177df7 100644 --- a/nova/tests/functional/api_sample_tests/test_extended_server_attributes.py +++ b/nova/tests/functional/api_sample_tests/test_extended_server_attributes.py @@ -13,13 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import test_servers -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class ExtendedServerAttributesJsonTest(test_servers.ServersSampleBase): diff --git a/nova/tests/functional/api_sample_tests/test_extended_status.py b/nova/tests/functional/api_sample_tests/test_extended_status.py index 53248b31bd08..1bcc0c9ec521 100644 --- a/nova/tests/functional/api_sample_tests/test_extended_status.py +++ b/nova/tests/functional/api_sample_tests/test_extended_status.py @@ -13,13 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import test_servers -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class ExtendedStatusSampleJsonTests(test_servers.ServersSampleBase): diff --git a/nova/tests/functional/api_sample_tests/test_extended_volumes.py b/nova/tests/functional/api_sample_tests/test_extended_volumes.py index e661c4379e22..1b130362ffb2 100644 --- a/nova/tests/functional/api_sample_tests/test_extended_volumes.py +++ b/nova/tests/functional/api_sample_tests/test_extended_volumes.py @@ -13,14 +13,11 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import test_servers from nova.tests.unit.api.openstack import fakes -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class ExtendedVolumesSampleJsonTests(test_servers.ServersSampleBase): diff --git a/nova/tests/functional/api_sample_tests/test_fixed_ips.py b/nova/tests/functional/api_sample_tests/test_fixed_ips.py index 270c638323e6..c02213215354 100644 --- a/nova/tests/functional/api_sample_tests/test_fixed_ips.py +++ b/nova/tests/functional/api_sample_tests/test_fixed_ips.py @@ -12,16 +12,13 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova import exception from nova.tests.functional.api_sample_tests import test_servers from nova.tests.unit.objects import test_network from nova.tests.unit import utils as test_utils -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class FixedIpTest(test_servers.ServersSampleBase): diff --git a/nova/tests/functional/api_sample_tests/test_flavor_access.py b/nova/tests/functional/api_sample_tests/test_flavor_access.py index 1bde8c75adf2..6f8c56646166 100644 --- a/nova/tests/functional/api_sample_tests/test_flavor_access.py +++ b/nova/tests/functional/api_sample_tests/test_flavor_access.py @@ -12,13 +12,10 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import api_sample_base -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class FlavorAccessTestsBase(api_sample_base.ApiSampleTestBaseV21): diff --git a/nova/tests/functional/api_sample_tests/test_flavor_extraspecs.py b/nova/tests/functional/api_sample_tests/test_flavor_extraspecs.py index 31f70f6768fc..cab90497ceb0 100644 --- a/nova/tests/functional/api_sample_tests/test_flavor_extraspecs.py +++ b/nova/tests/functional/api_sample_tests/test_flavor_extraspecs.py @@ -13,13 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import api_sample_base -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class FlavorExtraSpecsSampleJsonTests(api_sample_base.ApiSampleTestBaseV21): diff --git a/nova/tests/functional/api_sample_tests/test_flavor_manage.py b/nova/tests/functional/api_sample_tests/test_flavor_manage.py index e50c77343b69..aee25d13fc3d 100644 --- a/nova/tests/functional/api_sample_tests/test_flavor_manage.py +++ b/nova/tests/functional/api_sample_tests/test_flavor_manage.py @@ -13,13 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import api_sample_base -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class FlavorManageSampleJsonTests(api_sample_base.ApiSampleTestBaseV21): diff --git a/nova/tests/functional/api_sample_tests/test_flavor_rxtx.py b/nova/tests/functional/api_sample_tests/test_flavor_rxtx.py index 9af03a883d0a..e8f4d2c779e6 100644 --- a/nova/tests/functional/api_sample_tests/test_flavor_rxtx.py +++ b/nova/tests/functional/api_sample_tests/test_flavor_rxtx.py @@ -13,13 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import api_sample_base -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class FlavorRxtxJsonTest(api_sample_base.ApiSampleTestBaseV21): diff --git a/nova/tests/functional/api_sample_tests/test_flavors.py b/nova/tests/functional/api_sample_tests/test_flavors.py index b1fed700e67c..6c10dbe61c30 100644 --- a/nova/tests/functional/api_sample_tests/test_flavors.py +++ b/nova/tests/functional/api_sample_tests/test_flavors.py @@ -13,13 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import api_sample_base -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class FlavorsSampleJsonTest(api_sample_base.ApiSampleTestBaseV21): diff --git a/nova/tests/functional/api_sample_tests/test_floating_ip_dns.py b/nova/tests/functional/api_sample_tests/test_floating_ip_dns.py index fffcd206f7cc..ea706bfc23ed 100644 --- a/nova/tests/functional/api_sample_tests/test_floating_ip_dns.py +++ b/nova/tests/functional/api_sample_tests/test_floating_ip_dns.py @@ -12,13 +12,10 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import api_sample_base -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class FloatingIpDNSTest(api_sample_base.ApiSampleTestBaseV21): diff --git a/nova/tests/functional/api_sample_tests/test_floating_ip_pools.py b/nova/tests/functional/api_sample_tests/test_floating_ip_pools.py index 11362e4516f2..fa278241fc43 100644 --- a/nova/tests/functional/api_sample_tests/test_floating_ip_pools.py +++ b/nova/tests/functional/api_sample_tests/test_floating_ip_pools.py @@ -12,13 +12,10 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import api_sample_base -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class FloatingIPPoolsSampleTests(api_sample_base.ApiSampleTestBaseV21): diff --git a/nova/tests/functional/api_sample_tests/test_floating_ips.py b/nova/tests/functional/api_sample_tests/test_floating_ips.py index c838e6e4d685..7aafccd2f5a4 100644 --- a/nova/tests/functional/api_sample_tests/test_floating_ips.py +++ b/nova/tests/functional/api_sample_tests/test_floating_ips.py @@ -18,8 +18,6 @@ from nova import context from nova.tests.functional.api_sample_tests import api_sample_base CONF = nova.conf.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') class FloatingIpsTest(api_sample_base.ApiSampleTestBaseV21): diff --git a/nova/tests/functional/api_sample_tests/test_floating_ips_bulk.py b/nova/tests/functional/api_sample_tests/test_floating_ips_bulk.py index 154fdf0bf55f..0af432e95f4c 100644 --- a/nova/tests/functional/api_sample_tests/test_floating_ips_bulk.py +++ b/nova/tests/functional/api_sample_tests/test_floating_ips_bulk.py @@ -18,8 +18,6 @@ from nova import context from nova.tests.functional.api_sample_tests import api_sample_base CONF = nova.conf.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') class FloatingIpsBulkTest(api_sample_base.ApiSampleTestBaseV21): diff --git a/nova/tests/functional/api_sample_tests/test_fping.py b/nova/tests/functional/api_sample_tests/test_fping.py index 7a4d0e5aa536..19d9f845c5e8 100644 --- a/nova/tests/functional/api_sample_tests/test_fping.py +++ b/nova/tests/functional/api_sample_tests/test_fping.py @@ -13,14 +13,11 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import test_servers from nova.tests.unit.api.openstack.compute import test_fping -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class FpingSampleJsonTests(test_servers.ServersSampleBase): diff --git a/nova/tests/functional/api_sample_tests/test_hide_server_addresses.py b/nova/tests/functional/api_sample_tests/test_hide_server_addresses.py index 1fe6709408cc..56ef0932d442 100644 --- a/nova/tests/functional/api_sample_tests/test_hide_server_addresses.py +++ b/nova/tests/functional/api_sample_tests/test_hide_server_addresses.py @@ -18,8 +18,6 @@ import nova.conf from nova.tests.functional.api_sample_tests import test_servers CONF = nova.conf.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') class ServersSampleHideAddressesJsonTest(test_servers.ServersSampleJsonTest): diff --git a/nova/tests/functional/api_sample_tests/test_hosts.py b/nova/tests/functional/api_sample_tests/test_hosts.py index e84badac8f0f..294b0c0b8acc 100644 --- a/nova/tests/functional/api_sample_tests/test_hosts.py +++ b/nova/tests/functional/api_sample_tests/test_hosts.py @@ -13,13 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import api_sample_base -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class HostsSampleJsonTest(api_sample_base.ApiSampleTestBaseV21): diff --git a/nova/tests/functional/api_sample_tests/test_hypervisors.py b/nova/tests/functional/api_sample_tests/test_hypervisors.py index f6fa18ac76b6..dedbcb210010 100644 --- a/nova/tests/functional/api_sample_tests/test_hypervisors.py +++ b/nova/tests/functional/api_sample_tests/test_hypervisors.py @@ -14,15 +14,13 @@ # under the License. import mock -from oslo_config import cfg from nova.cells import utils as cells_utils +import nova.conf from nova import objects from nova.tests.functional.api_sample_tests import api_sample_base -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class HypervisorsSampleJsonTests(api_sample_base.ApiSampleTestBaseV21): diff --git a/nova/tests/functional/api_sample_tests/test_images.py b/nova/tests/functional/api_sample_tests/test_images.py index f818c82059a6..ade68dd458bf 100644 --- a/nova/tests/functional/api_sample_tests/test_images.py +++ b/nova/tests/functional/api_sample_tests/test_images.py @@ -13,14 +13,11 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import api_sample_base from nova.tests.unit.image import fake -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class ImagesSampleJsonTest(api_sample_base.ApiSampleTestBaseV21): diff --git a/nova/tests/functional/api_sample_tests/test_instance_actions.py b/nova/tests/functional/api_sample_tests/test_instance_actions.py index f825bb9f2dcc..175c6f0b5452 100644 --- a/nova/tests/functional/api_sample_tests/test_instance_actions.py +++ b/nova/tests/functional/api_sample_tests/test_instance_actions.py @@ -15,17 +15,15 @@ import copy -from oslo_config import cfg import six +import nova.conf from nova.tests.functional.api_sample_tests import api_sample_base from nova.tests.unit import fake_instance from nova.tests.unit import fake_server_actions from nova.tests.unit import utils as test_utils -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class ServerActionsSampleJsonTest(api_sample_base.ApiSampleTestBaseV21): diff --git a/nova/tests/functional/api_sample_tests/test_instance_usage_audit_log.py b/nova/tests/functional/api_sample_tests/test_instance_usage_audit_log.py index 363b3745e939..67c78733b526 100644 --- a/nova/tests/functional/api_sample_tests/test_instance_usage_audit_log.py +++ b/nova/tests/functional/api_sample_tests/test_instance_usage_audit_log.py @@ -15,13 +15,10 @@ import urllib -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import api_sample_base -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class InstanceUsageAuditLogJsonTest(api_sample_base.ApiSampleTestBaseV21): diff --git a/nova/tests/functional/api_sample_tests/test_keypairs.py b/nova/tests/functional/api_sample_tests/test_keypairs.py index 3065153d8e65..c2d549e4dad4 100644 --- a/nova/tests/functional/api_sample_tests/test_keypairs.py +++ b/nova/tests/functional/api_sample_tests/test_keypairs.py @@ -15,15 +15,12 @@ import uuid -from oslo_config import cfg - +import nova.conf from nova.objects import keypair as keypair_obj from nova.tests.functional.api_sample_tests import api_sample_base from nova.tests.unit import fake_crypto -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class KeyPairsSampleJsonTest(api_sample_base.ApiSampleTestBaseV21): diff --git a/nova/tests/functional/api_sample_tests/test_limits.py b/nova/tests/functional/api_sample_tests/test_limits.py index 224393916f61..4e6304a69357 100644 --- a/nova/tests/functional/api_sample_tests/test_limits.py +++ b/nova/tests/functional/api_sample_tests/test_limits.py @@ -13,13 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import api_sample_base -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class LimitsSampleJsonTest(api_sample_base.ApiSampleTestBaseV21): diff --git a/nova/tests/functional/api_sample_tests/test_lock_server.py b/nova/tests/functional/api_sample_tests/test_lock_server.py index 2d9f394971ab..bcfdf06b4f36 100644 --- a/nova/tests/functional/api_sample_tests/test_lock_server.py +++ b/nova/tests/functional/api_sample_tests/test_lock_server.py @@ -13,13 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import test_servers -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class LockServerSamplesJsonTest(test_servers.ServersSampleBase): diff --git a/nova/tests/functional/api_sample_tests/test_migrate_server.py b/nova/tests/functional/api_sample_tests/test_migrate_server.py index 49b388cf14b3..e620e7dbccc8 100644 --- a/nova/tests/functional/api_sample_tests/test_migrate_server.py +++ b/nova/tests/functional/api_sample_tests/test_migrate_server.py @@ -14,14 +14,12 @@ # under the License. import mock -from oslo_config import cfg from oslo_utils import versionutils +import nova.conf from nova.tests.functional.api_sample_tests import test_servers -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class MigrateServerSamplesJsonTest(test_servers.ServersSampleBase): diff --git a/nova/tests/functional/api_sample_tests/test_migrations.py b/nova/tests/functional/api_sample_tests/test_migrations.py index 4a5dffecac34..6665047d795f 100644 --- a/nova/tests/functional/api_sample_tests/test_migrations.py +++ b/nova/tests/functional/api_sample_tests/test_migrations.py @@ -15,15 +15,12 @@ import datetime -from oslo_config import cfg - +import nova.conf from nova import context from nova import objects from nova.tests.functional.api_sample_tests import api_sample_base -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF # NOTE(ShaoHe Feng) here I can not use uuidsentinel, it generate a random diff --git a/nova/tests/functional/api_sample_tests/test_multinic.py b/nova/tests/functional/api_sample_tests/test_multinic.py index 8fa72ae32584..6d9e1bc4827c 100644 --- a/nova/tests/functional/api_sample_tests/test_multinic.py +++ b/nova/tests/functional/api_sample_tests/test_multinic.py @@ -13,13 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import test_servers -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class MultinicSampleJsonTest(test_servers.ServersSampleBase): diff --git a/nova/tests/functional/api_sample_tests/test_multiple_create.py b/nova/tests/functional/api_sample_tests/test_multiple_create.py index bf1812875656..86aeef38fb9b 100644 --- a/nova/tests/functional/api_sample_tests/test_multiple_create.py +++ b/nova/tests/functional/api_sample_tests/test_multiple_create.py @@ -13,14 +13,11 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import test_servers from nova.tests.unit.image import fake -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class MultipleCreateJsonTest(test_servers.ServersSampleBase): diff --git a/nova/tests/functional/api_sample_tests/test_networks.py b/nova/tests/functional/api_sample_tests/test_networks.py index 215c77bb9b5c..2d70b4dc7bc2 100644 --- a/nova/tests/functional/api_sample_tests/test_networks.py +++ b/nova/tests/functional/api_sample_tests/test_networks.py @@ -13,14 +13,11 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import api_sample_base from nova.tests.unit.api.openstack.compute import test_networks -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class NetworksJsonTests(api_sample_base.ApiSampleTestBaseV21): diff --git a/nova/tests/functional/api_sample_tests/test_networks_associate.py b/nova/tests/functional/api_sample_tests/test_networks_associate.py index 7f31bf11545e..7723203bd7b9 100644 --- a/nova/tests/functional/api_sample_tests/test_networks_associate.py +++ b/nova/tests/functional/api_sample_tests/test_networks_associate.py @@ -13,13 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import api_sample_base -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class NetworksAssociateJsonTests(api_sample_base.ApiSampleTestBaseV21): diff --git a/nova/tests/functional/api_sample_tests/test_pause_server.py b/nova/tests/functional/api_sample_tests/test_pause_server.py index c27d6dd2d471..dc973bc8898c 100644 --- a/nova/tests/functional/api_sample_tests/test_pause_server.py +++ b/nova/tests/functional/api_sample_tests/test_pause_server.py @@ -13,13 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import test_servers -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class PauseServerSamplesJsonTest(test_servers.ServersSampleBase): diff --git a/nova/tests/functional/api_sample_tests/test_preserve_ephemeral_rebuild.py b/nova/tests/functional/api_sample_tests/test_preserve_ephemeral_rebuild.py index 28d75801b029..9cbfc9ec9a09 100644 --- a/nova/tests/functional/api_sample_tests/test_preserve_ephemeral_rebuild.py +++ b/nova/tests/functional/api_sample_tests/test_preserve_ephemeral_rebuild.py @@ -12,15 +12,12 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - from nova.compute import api as compute_api +import nova.conf from nova.tests.functional.api_sample_tests import test_servers from nova.tests.unit.image import fake -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class PreserveEphemeralOnRebuildJsonTest(test_servers.ServersSampleBase): diff --git a/nova/tests/functional/api_sample_tests/test_quota_classes.py b/nova/tests/functional/api_sample_tests/test_quota_classes.py index 3d9faa17b5fc..0b33aac415a7 100644 --- a/nova/tests/functional/api_sample_tests/test_quota_classes.py +++ b/nova/tests/functional/api_sample_tests/test_quota_classes.py @@ -13,13 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import api_sample_base -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class QuotaClassesSampleJsonTests(api_sample_base.ApiSampleTestBaseV21): diff --git a/nova/tests/functional/api_sample_tests/test_quota_sets.py b/nova/tests/functional/api_sample_tests/test_quota_sets.py index d7ab8367c575..3b6c5aa7c57e 100644 --- a/nova/tests/functional/api_sample_tests/test_quota_sets.py +++ b/nova/tests/functional/api_sample_tests/test_quota_sets.py @@ -13,13 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import api_sample_base -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class QuotaSetsSampleJsonTests(api_sample_base.ApiSampleTestBaseV21): diff --git a/nova/tests/functional/api_sample_tests/test_remote_consoles.py b/nova/tests/functional/api_sample_tests/test_remote_consoles.py index 83a93a464458..7def88f2e185 100644 --- a/nova/tests/functional/api_sample_tests/test_remote_consoles.py +++ b/nova/tests/functional/api_sample_tests/test_remote_consoles.py @@ -13,13 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import test_servers -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class ConsolesSampleJsonTests(test_servers.ServersSampleBase): diff --git a/nova/tests/functional/api_sample_tests/test_rescue.py b/nova/tests/functional/api_sample_tests/test_rescue.py index f08ba9ea56e7..1b422f808405 100644 --- a/nova/tests/functional/api_sample_tests/test_rescue.py +++ b/nova/tests/functional/api_sample_tests/test_rescue.py @@ -13,14 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import test_servers - -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class RescueJsonTest(test_servers.ServersSampleBase): diff --git a/nova/tests/functional/api_sample_tests/test_scheduler_hints.py b/nova/tests/functional/api_sample_tests/test_scheduler_hints.py index 119410379faa..e41229b2a1e1 100644 --- a/nova/tests/functional/api_sample_tests/test_scheduler_hints.py +++ b/nova/tests/functional/api_sample_tests/test_scheduler_hints.py @@ -15,14 +15,11 @@ import uuid -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import api_sample_base from nova.tests.unit.image import fake -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class SchedulerHintsJsonTest(api_sample_base.ApiSampleTestBaseV21): diff --git a/nova/tests/functional/api_sample_tests/test_security_group_default_rules.py b/nova/tests/functional/api_sample_tests/test_security_group_default_rules.py index db4e7a76107b..413f30b806c3 100644 --- a/nova/tests/functional/api_sample_tests/test_security_group_default_rules.py +++ b/nova/tests/functional/api_sample_tests/test_security_group_default_rules.py @@ -12,13 +12,10 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import api_sample_base -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class SecurityGroupDefaultRulesSampleJsonTest( diff --git a/nova/tests/functional/api_sample_tests/test_security_groups.py b/nova/tests/functional/api_sample_tests/test_security_groups.py index 0e51f639b985..614375ff3e3c 100644 --- a/nova/tests/functional/api_sample_tests/test_security_groups.py +++ b/nova/tests/functional/api_sample_tests/test_security_groups.py @@ -13,14 +13,11 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import test_servers import nova.tests.functional.api_samples_test_base as astb -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF def fake_get(*args, **kwargs): diff --git a/nova/tests/functional/api_sample_tests/test_server_diagnostics.py b/nova/tests/functional/api_sample_tests/test_server_diagnostics.py index c501c1511076..ebf10c4ff1a3 100644 --- a/nova/tests/functional/api_sample_tests/test_server_diagnostics.py +++ b/nova/tests/functional/api_sample_tests/test_server_diagnostics.py @@ -13,13 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import test_servers -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class ServerDiagnosticsSamplesJsonTest(test_servers.ServersSampleBase): diff --git a/nova/tests/functional/api_sample_tests/test_server_external_events.py b/nova/tests/functional/api_sample_tests/test_server_external_events.py index d8ba14941d85..2c4a9a130879 100644 --- a/nova/tests/functional/api_sample_tests/test_server_external_events.py +++ b/nova/tests/functional/api_sample_tests/test_server_external_events.py @@ -12,13 +12,10 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import test_servers -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class ServerExternalEventsSamplesJsonTest(test_servers.ServersSampleBase): diff --git a/nova/tests/functional/api_sample_tests/test_server_groups.py b/nova/tests/functional/api_sample_tests/test_server_groups.py index 70087d927e5d..50c668e2d802 100644 --- a/nova/tests/functional/api_sample_tests/test_server_groups.py +++ b/nova/tests/functional/api_sample_tests/test_server_groups.py @@ -13,13 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import api_sample_base -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class ServerGroupsSampleJsonTest(api_sample_base.ApiSampleTestBaseV21): diff --git a/nova/tests/functional/api_sample_tests/test_server_metadata.py b/nova/tests/functional/api_sample_tests/test_server_metadata.py index aaecadc2c04d..6eb158e39399 100644 --- a/nova/tests/functional/api_sample_tests/test_server_metadata.py +++ b/nova/tests/functional/api_sample_tests/test_server_metadata.py @@ -13,13 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import test_servers -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class ServersMetadataJsonTest(test_servers.ServersSampleBase): diff --git a/nova/tests/functional/api_sample_tests/test_server_password.py b/nova/tests/functional/api_sample_tests/test_server_password.py index 3f06dbc4db2b..5dd201a87f0f 100644 --- a/nova/tests/functional/api_sample_tests/test_server_password.py +++ b/nova/tests/functional/api_sample_tests/test_server_password.py @@ -13,13 +13,11 @@ # under the License. import mock -from oslo_config import cfg +import nova.conf from nova.tests.functional.api_sample_tests import test_servers -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class ServerPasswordSampleJsonTests(test_servers.ServersSampleBase): diff --git a/nova/tests/functional/api_sample_tests/test_server_usage.py b/nova/tests/functional/api_sample_tests/test_server_usage.py index dc133cb66991..a1d75170748b 100644 --- a/nova/tests/functional/api_sample_tests/test_server_usage.py +++ b/nova/tests/functional/api_sample_tests/test_server_usage.py @@ -13,13 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import test_servers -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class ServerUsageSampleJsonTest(test_servers.ServersSampleBase): diff --git a/nova/tests/functional/api_sample_tests/test_servers.py b/nova/tests/functional/api_sample_tests/test_servers.py index f182c9cc00a7..a6064372e63c 100644 --- a/nova/tests/functional/api_sample_tests/test_servers.py +++ b/nova/tests/functional/api_sample_tests/test_servers.py @@ -13,14 +13,11 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import api_sample_base from nova.tests.unit.image import fake -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class ServersSampleBase(api_sample_base.ApiSampleTestBaseV21): diff --git a/nova/tests/functional/api_sample_tests/test_servers_ips.py b/nova/tests/functional/api_sample_tests/test_servers_ips.py index 8e964d14cc1d..c68ece76680a 100644 --- a/nova/tests/functional/api_sample_tests/test_servers_ips.py +++ b/nova/tests/functional/api_sample_tests/test_servers_ips.py @@ -13,13 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import test_servers -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class ServersIpsJsonTest(test_servers.ServersSampleBase): diff --git a/nova/tests/functional/api_sample_tests/test_services.py b/nova/tests/functional/api_sample_tests/test_services.py index fef17f8dfabe..0603aca19fab 100644 --- a/nova/tests/functional/api_sample_tests/test_services.py +++ b/nova/tests/functional/api_sample_tests/test_services.py @@ -13,16 +13,14 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg from oslo_utils import fixture as utils_fixture +import nova.conf from nova.tests.functional.api_sample_tests import api_sample_base from nova.tests.unit.api.openstack.compute import test_services -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class ServicesJsonTest(api_sample_base.ApiSampleTestBaseV21): diff --git a/nova/tests/functional/api_sample_tests/test_shelve.py b/nova/tests/functional/api_sample_tests/test_shelve.py index 6db882539571..7ec20d9f891d 100644 --- a/nova/tests/functional/api_sample_tests/test_shelve.py +++ b/nova/tests/functional/api_sample_tests/test_shelve.py @@ -18,8 +18,6 @@ import nova.conf from nova.tests.functional.api_sample_tests import test_servers CONF = nova.conf.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') class ShelveJsonTest(test_servers.ServersSampleBase): diff --git a/nova/tests/functional/api_sample_tests/test_simple_tenant_usage.py b/nova/tests/functional/api_sample_tests/test_simple_tenant_usage.py index 40bb350f116a..93e109d556ca 100644 --- a/nova/tests/functional/api_sample_tests/test_simple_tenant_usage.py +++ b/nova/tests/functional/api_sample_tests/test_simple_tenant_usage.py @@ -15,15 +15,13 @@ import datetime import urllib -from oslo_config import cfg from oslo_utils import timeutils +import nova.conf from nova.tests.functional.api_sample_tests import test_servers import nova.tests.functional.api_samples_test_base as astb -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class SimpleTenantUsageSampleJsonTest(test_servers.ServersSampleBase): diff --git a/nova/tests/functional/api_sample_tests/test_suspend_server.py b/nova/tests/functional/api_sample_tests/test_suspend_server.py index 1d91048b73fd..587fea4600f7 100644 --- a/nova/tests/functional/api_sample_tests/test_suspend_server.py +++ b/nova/tests/functional/api_sample_tests/test_suspend_server.py @@ -12,13 +12,10 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import test_servers -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class SuspendServerSamplesJsonTest(test_servers.ServersSampleBase): diff --git a/nova/tests/functional/api_sample_tests/test_tenant_networks.py b/nova/tests/functional/api_sample_tests/test_tenant_networks.py index 15827f3b05e4..7092f190fb0a 100644 --- a/nova/tests/functional/api_sample_tests/test_tenant_networks.py +++ b/nova/tests/functional/api_sample_tests/test_tenant_networks.py @@ -14,17 +14,12 @@ # under the License. -from oslo_config import cfg from oslo_serialization import jsonutils +import nova.conf from nova.tests.functional.api_sample_tests import api_sample_base -CONF = cfg.CONF -CONF.import_opt('enable_network_quota', - 'nova.api.openstack.compute.legacy_v2.contrib.' - 'os_tenant_networks') -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class TenantNetworksJsonTests(api_sample_base.ApiSampleTestBaseV21): diff --git a/nova/tests/functional/api_sample_tests/test_used_limits.py b/nova/tests/functional/api_sample_tests/test_used_limits.py index 3e50ecf512ff..e2b84a41cc16 100644 --- a/nova/tests/functional/api_sample_tests/test_used_limits.py +++ b/nova/tests/functional/api_sample_tests/test_used_limits.py @@ -13,13 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import api_sample_base -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class UsedLimitsSamplesJsonTest(api_sample_base.ApiSampleTestBaseV21): diff --git a/nova/tests/functional/api_sample_tests/test_user_data.py b/nova/tests/functional/api_sample_tests/test_user_data.py index 8ae5c08b7952..7efed3c53b59 100644 --- a/nova/tests/functional/api_sample_tests/test_user_data.py +++ b/nova/tests/functional/api_sample_tests/test_user_data.py @@ -14,14 +14,12 @@ # under the License. import base64 -from oslo_config import cfg +import nova.conf from nova.tests.functional.api_sample_tests import api_sample_base from nova.tests.unit.image import fake -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class UserDataJsonTest(api_sample_base.ApiSampleTestBaseV21): diff --git a/nova/tests/functional/api_sample_tests/test_virtual_interfaces.py b/nova/tests/functional/api_sample_tests/test_virtual_interfaces.py index 14d9c57f0e2f..03a98863b560 100644 --- a/nova/tests/functional/api_sample_tests/test_virtual_interfaces.py +++ b/nova/tests/functional/api_sample_tests/test_virtual_interfaces.py @@ -13,13 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - +import nova.conf from nova.tests.functional.api_sample_tests import test_servers -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class VirtualInterfacesJsonTest(test_servers.ServersSampleBase): diff --git a/nova/tests/functional/api_sample_tests/test_volumes.py b/nova/tests/functional/api_sample_tests/test_volumes.py index 8eba7b643971..9ae6a5d23f0f 100644 --- a/nova/tests/functional/api_sample_tests/test_volumes.py +++ b/nova/tests/functional/api_sample_tests/test_volumes.py @@ -13,10 +13,9 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg - import datetime +import nova.conf from nova import context from nova import objects from nova.tests.functional.api_sample_tests import api_sample_base @@ -25,9 +24,7 @@ from nova.tests.unit.api.openstack import fakes from nova.tests.unit import fake_block_device from nova.tests.unit import fake_instance -CONF = cfg.CONF -CONF.import_opt('osapi_compute_extension', - 'nova.api.openstack.compute.legacy_v2.extensions') +CONF = nova.conf.CONF class SnapshotsSampleJsonTests(api_sample_base.ApiSampleTestBaseV21): diff --git a/nova/tests/unit/api/openstack/compute/test_server_password.py b/nova/tests/unit/api/openstack/compute/test_server_password.py index 01d443e448b1..3ce05f3a9886 100644 --- a/nova/tests/unit/api/openstack/compute/test_server_password.py +++ b/nova/tests/unit/api/openstack/compute/test_server_password.py @@ -15,8 +15,6 @@ import mock -from oslo_config import cfg - from nova.api.metadata import password from nova.api.openstack.compute import server_password \ as server_password_v21 @@ -27,9 +25,6 @@ from nova.tests.unit.api.openstack import fakes from nova.tests.unit import fake_instance -CONF = cfg.CONF - - class ServerPasswordTestV21(test.NoDBTestCase): content_type = 'application/json' server_password = server_password_v21 diff --git a/setup.cfg b/setup.cfg index 31c109d7ba29..56ad9298f7b9 100644 --- a/setup.cfg +++ b/setup.cfg @@ -28,7 +28,6 @@ packages = oslo.config.opts = nova = nova.opts:list_opts nova.conf = nova.conf.opts:list_opts - nova.api = nova.api.opts:list_opts nova.cells = nova.cells.opts:list_opts nova.compute = nova.compute.opts:list_opts nova.network.neutronv2 = nova.network.neutronv2.api:list_opts