From b6dd96c342ef637a3570e5bbee3dfcd49368c47b Mon Sep 17 00:00:00 2001 From: EdLeafe Date: Thu, 21 Apr 2016 15:53:54 +0000 Subject: [PATCH] Move config options from nova/api directory (5) This is the fifth and final patch moving config options from the nova/api directory. In this patch, the deprecated options from the legacy_v2 directory have been moved to nova/conf/legacy_v2.py. A subsequent patch will enhance the help text for these options. Blueprint centralize-config-options-newton Change-Id: I3fdff0d3c0c2f36155ad4f7060395e788b78d150 --- .../compute/legacy_v2/contrib/__init__.py | 16 +------ .../openstack/compute/legacy_v2/extensions.py | 15 +----- nova/api/opts.py | 26 ---------- nova/conf/__init__.py | 4 +- nova/conf/legacy_api.py | 47 +++++++++++++++++++ .../api_sample_tests/api_sample_base.py | 2 - .../api_sample_tests/test_access_ips.py | 7 +-- .../api_sample_tests/test_admin_actions.py | 7 +-- .../api_sample_tests/test_admin_password.py | 7 +-- .../api_sample_tests/test_agents.py | 7 +-- .../api_sample_tests/test_aggregates.py | 7 +-- .../test_assisted_volume_snapshots.py | 7 +-- .../test_attach_interfaces.py | 7 +-- .../test_availability_zone.py | 2 - .../api_sample_tests/test_baremetal_nodes.py | 7 +-- .../test_block_device_mapping_boot.py | 7 +-- .../functional/api_sample_tests/test_cells.py | 2 - .../api_sample_tests/test_certificates.py | 7 +-- .../api_sample_tests/test_cloudpipe.py | 7 +-- .../api_sample_tests/test_config_drive.py | 7 +-- .../test_console_auth_tokens.py | 6 +-- .../api_sample_tests/test_console_output.py | 7 +-- .../api_sample_tests/test_create_backup.py | 7 +-- .../api_sample_tests/test_deferred_delete.py | 7 +-- .../api_sample_tests/test_disk_config.py | 7 +-- .../api_sample_tests/test_evacuate.py | 6 +-- .../test_extended_availability_zone.py | 7 +-- .../test_extended_server_attributes.py | 7 +-- .../api_sample_tests/test_extended_status.py | 7 +-- .../api_sample_tests/test_extended_volumes.py | 7 +-- .../api_sample_tests/test_fixed_ips.py | 7 +-- .../api_sample_tests/test_flavor_access.py | 7 +-- .../test_flavor_extraspecs.py | 7 +-- .../api_sample_tests/test_flavor_manage.py | 7 +-- .../api_sample_tests/test_flavor_rxtx.py | 7 +-- .../api_sample_tests/test_flavors.py | 7 +-- .../api_sample_tests/test_floating_ip_dns.py | 7 +-- .../test_floating_ip_pools.py | 7 +-- .../api_sample_tests/test_floating_ips.py | 2 - .../test_floating_ips_bulk.py | 2 - .../functional/api_sample_tests/test_fping.py | 7 +-- .../test_hide_server_addresses.py | 2 - .../functional/api_sample_tests/test_hosts.py | 7 +-- .../api_sample_tests/test_hypervisors.py | 6 +-- .../api_sample_tests/test_images.py | 7 +-- .../api_sample_tests/test_instance_actions.py | 6 +-- .../test_instance_usage_audit_log.py | 7 +-- .../api_sample_tests/test_keypairs.py | 7 +-- .../api_sample_tests/test_limits.py | 7 +-- .../api_sample_tests/test_lock_server.py | 7 +-- .../api_sample_tests/test_migrate_server.py | 6 +-- .../api_sample_tests/test_migrations.py | 7 +-- .../api_sample_tests/test_multinic.py | 7 +-- .../api_sample_tests/test_multiple_create.py | 7 +-- .../api_sample_tests/test_networks.py | 7 +-- .../test_networks_associate.py | 7 +-- .../api_sample_tests/test_pause_server.py | 7 +-- .../test_preserve_ephemeral_rebuild.py | 7 +-- .../api_sample_tests/test_quota_classes.py | 7 +-- .../api_sample_tests/test_quota_sets.py | 7 +-- .../api_sample_tests/test_remote_consoles.py | 7 +-- .../api_sample_tests/test_rescue.py | 8 +--- .../api_sample_tests/test_scheduler_hints.py | 7 +-- .../test_security_group_default_rules.py | 7 +-- .../api_sample_tests/test_security_groups.py | 7 +-- .../test_server_diagnostics.py | 7 +-- .../test_server_external_events.py | 7 +-- .../api_sample_tests/test_server_groups.py | 7 +-- .../api_sample_tests/test_server_metadata.py | 7 +-- .../api_sample_tests/test_server_password.py | 6 +-- .../api_sample_tests/test_server_usage.py | 7 +-- .../api_sample_tests/test_servers.py | 7 +-- .../api_sample_tests/test_servers_ips.py | 7 +-- .../api_sample_tests/test_services.py | 6 +-- .../api_sample_tests/test_shelve.py | 2 - .../test_simple_tenant_usage.py | 6 +-- .../api_sample_tests/test_suspend_server.py | 7 +-- .../api_sample_tests/test_tenant_networks.py | 9 +--- .../api_sample_tests/test_used_limits.py | 7 +-- .../api_sample_tests/test_user_data.py | 6 +-- .../test_virtual_interfaces.py | 7 +-- .../api_sample_tests/test_volumes.py | 7 +-- .../openstack/compute/test_server_password.py | 5 -- setup.cfg | 1 - 84 files changed, 193 insertions(+), 419 deletions(-) delete mode 100644 nova/api/opts.py create mode 100644 nova/conf/legacy_api.py diff --git a/nova/api/openstack/compute/legacy_v2/contrib/__init__.py b/nova/api/openstack/compute/legacy_v2/contrib/__init__.py index a59ffe8e9e..a51bb9232d 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 af030a0307..68839cce91 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 7194e3072f..0000000000 --- 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 943f9e72bf..506cb9e7af 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 0000000000..1a25a3b462 --- /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 29a7dd2969..000bb9b3f2 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 d89fa63f55..a07a4d68f2 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 225300f207..ac157b15f1 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 9b23c88d2a..e86408666a 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 ffec570305..c89bb9975a 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 0791838511..da3d0de563 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 38d9a44c06..178432bc27 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 fe4d3576e9..f30fe6be96 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 0c95ee5766..6bee7e1165 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 859aca22ab..536e62991a 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 36e6e5188d..e21048e22f 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 e149b29864..e1a8e1ff69 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 aa94f0632b..24d34b051b 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 481d89bd79..7f56fd052c 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 18901bbb76..987b9941ed 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 448a23d6d2..35d9367960 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 7d335cacc8..b10a942d70 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 97f2a6c59f..2ee00de40d 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 175061b284..ca12495293 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 c745e8b6a1..d48e201117 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 da8569ab68..21ba5b5ff5 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 1e103be557..653dc49ab6 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 a749c00a11..a8c7f9177d 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 53248b31bd..1bcc0c9ec5 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 e661c4379e..1b130362ff 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 270c638323..c022132153 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 1bde8c75ad..6f8c566461 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 31f70f6768..cab90497ce 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 e50c77343b..aee25d13fc 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 9af03a883d..e8f4d2c779 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 b1fed700e6..6c10dbe61c 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 fffcd206f7..ea706bfc23 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 11362e4516..fa278241fc 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 c838e6e4d6..7aafccd2f5 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 154fdf0bf5..0af432e95f 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 7a4d0e5aa5..19d9f845c5 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 1fe6709408..56ef0932d4 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 e84badac8f..294b0c0b8a 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 f6fa18ac76..dedbcb2100 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 f818c82059..ade68dd458 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 f825bb9f2d..175c6f0b54 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 363b3745e9..67c78733b5 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 3065153d8e..c2d549e4da 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 224393916f..4e6304a693 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 2d9f394971..bcfdf06b4f 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 49b388cf14..e620e7dbcc 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 4a5dffecac..6665047d79 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 8fa72ae325..6d9e1bc482 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 bf18128756..86aeef38fb 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 215c77bb9b..2d70b4dc7b 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 7f31bf1154..7723203bd7 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 c27d6dd2d4..dc973bc889 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 28d75801b0..9cbfc9ec9a 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 3d9faa17b5..0b33aac415 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 d7ab8367c5..3b6c5aa7c5 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 83a93a4644..7def88f2e1 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 f08ba9ea56..1b422f8084 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 119410379f..e41229b2a1 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 db4e7a7610..413f30b806 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 0e51f639b9..614375ff3e 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 c501c15110..ebf10c4ff1 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 d8ba14941d..2c4a9a1308 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 70087d927e..50c668e2d8 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 aaecadc2c0..6eb158e393 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 3f06dbc4db..5dd201a87f 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 dc133cb669..a1d7517074 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 f182c9cc00..a6064372e6 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 8e964d14cc..c68ece7668 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 fef17f8dfa..0603aca19f 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 6db8825395..7ec20d9f89 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 40bb350f11..93e109d556 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 1d91048b73..587fea4600 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 15827f3b05..7092f190fb 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 3e50ecf512..e2b84a41cc 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 8ae5c08b79..7efed3c53b 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 14d9c57f0e..03a98863b5 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 8eba7b6439..9ae6a5d23f 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 01d443e448..3ce05f3a98 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 31c109d7ba..56ad9298f7 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