Remove more 'v3' references from the code
This is part of the V3 cleanup effort. The 'ApiSampleTestBaseV3' class has been renamed to 'ApiSampleTestBaseV21', and all references to it updated. Also, all references to the 'nova.api.v3' extension namespace have been renamed to 'nova.api.v21'. Finally, some code that used short variable names like 'v1', 'v2', etc., has been updated to rename these 'vers1', 'vers2', to avoid confusion with the v3 issue. Change-Id: I23eab21c7158ba319e060bd075ef25afc5365381
This commit is contained in:
parent
4eb2e087b9
commit
28d2b0df5a
@ -312,9 +312,7 @@ class APIRouterV21(base_wsgi.Router):
|
||||
|
||||
@staticmethod
|
||||
def api_extension_namespace():
|
||||
# TODO(oomichi): This namespaces will be changed after moving all v3
|
||||
# APIs to v2.1.
|
||||
return 'nova.api.v3.extensions'
|
||||
return 'nova.api.v21.extensions'
|
||||
|
||||
def __init__(self, init_only=None, v3mode=False):
|
||||
# TODO(cyeoh): bp v3-api-extension-framework. Currently load
|
||||
|
@ -63,17 +63,17 @@ authorize = extensions.os_compute_authorizer(ALIAS)
|
||||
class ServersController(wsgi.Controller):
|
||||
"""The Server API base controller class for the OpenStack API."""
|
||||
|
||||
EXTENSION_CREATE_NAMESPACE = 'nova.api.v3.extensions.server.create'
|
||||
EXTENSION_CREATE_NAMESPACE = 'nova.api.v21.extensions.server.create'
|
||||
EXTENSION_DESERIALIZE_EXTRACT_SERVER_NAMESPACE = (
|
||||
'nova.api.v3.extensions.server.create.deserialize')
|
||||
'nova.api.v21.extensions.server.create.deserialize')
|
||||
|
||||
EXTENSION_REBUILD_NAMESPACE = 'nova.api.v3.extensions.server.rebuild'
|
||||
EXTENSION_REBUILD_NAMESPACE = 'nova.api.v21.extensions.server.rebuild'
|
||||
EXTENSION_DESERIALIZE_EXTRACT_REBUILD_NAMESPACE = (
|
||||
'nova.api.v3.extensions.server.rebuild.deserialize')
|
||||
'nova.api.v21.extensions.server.rebuild.deserialize')
|
||||
|
||||
EXTENSION_UPDATE_NAMESPACE = 'nova.api.v3.extensions.server.update'
|
||||
EXTENSION_UPDATE_NAMESPACE = 'nova.api.v21.extensions.server.update'
|
||||
|
||||
EXTENSION_RESIZE_NAMESPACE = 'nova.api.v3.extensions.server.resize'
|
||||
EXTENSION_RESIZE_NAMESPACE = 'nova.api.v21.extensions.server.resize'
|
||||
|
||||
_view_builder_class = views_servers.ViewBuilderV3
|
||||
|
||||
|
@ -29,7 +29,7 @@ from nova.tests.unit import fake_utils
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
||||
class ApiSampleTestBaseV3(testscenarios.WithScenarios,
|
||||
class ApiSampleTestBaseV21(testscenarios.WithScenarios,
|
||||
api_samples_test_base.ApiSampleTestBase):
|
||||
_api_version = 'v2'
|
||||
sample_dir = None
|
||||
@ -69,8 +69,7 @@ class ApiSampleTestBaseV3(testscenarios.WithScenarios,
|
||||
elif (self._test == 'v2' and self._api_version == 'v2'):
|
||||
# override /v2 in compatibility mode with v2 legacy
|
||||
self.useFixture(api_paste_fixture.ApiPasteLegacyV2Fixture())
|
||||
|
||||
super(ApiSampleTestBaseV3, self).setUp()
|
||||
super(ApiSampleTestBaseV21, self).setUp()
|
||||
self.useFixture(test.SampleNetworks(host=self.network.host))
|
||||
fake_network.stub_compute_with_ips(self.stubs)
|
||||
fake_utils.stub_out_utils_spawn_n(self.stubs)
|
||||
|
@ -23,7 +23,7 @@ CONF.import_opt('osapi_compute_extension',
|
||||
'nova.api.openstack.compute.legacy_v2.extensions')
|
||||
|
||||
|
||||
class AccessIPsSampleJsonTest(api_sample_base.ApiSampleTestBaseV3):
|
||||
class AccessIPsSampleJsonTest(api_sample_base.ApiSampleTestBaseV21):
|
||||
extension_name = 'os-access-ips'
|
||||
|
||||
def _get_flags(self):
|
||||
|
@ -24,7 +24,7 @@ CONF.import_opt('osapi_compute_extension',
|
||||
'nova.api.openstack.compute.legacy_v2.extensions')
|
||||
|
||||
|
||||
class AgentsJsonTest(api_sample_base.ApiSampleTestBaseV3):
|
||||
class AgentsJsonTest(api_sample_base.ApiSampleTestBaseV21):
|
||||
ADMIN_API = True
|
||||
extension_name = "os-agents"
|
||||
|
||||
|
@ -22,7 +22,7 @@ CONF.import_opt('osapi_compute_extension',
|
||||
'nova.api.openstack.compute.legacy_v2.extensions')
|
||||
|
||||
|
||||
class AggregatesSampleJsonTest(api_sample_base.ApiSampleTestBaseV3):
|
||||
class AggregatesSampleJsonTest(api_sample_base.ApiSampleTestBaseV21):
|
||||
ADMIN_API = True
|
||||
extension_name = "os-aggregates"
|
||||
|
||||
|
@ -48,7 +48,7 @@ class fake_client(object):
|
||||
node = NodeManager()
|
||||
|
||||
|
||||
class BareMetalNodesSampleJsonTest(api_sample_base.ApiSampleTestBaseV3):
|
||||
class BareMetalNodesSampleJsonTest(api_sample_base.ApiSampleTestBaseV21):
|
||||
ADMIN_API = True
|
||||
extension_name = "os-baremetal-nodes"
|
||||
|
||||
|
@ -28,7 +28,7 @@ CONF.import_opt('osapi_compute_extension',
|
||||
'nova.api.openstack.compute.legacy_v2.extensions')
|
||||
|
||||
|
||||
class CellsSampleJsonTest(api_sample_base.ApiSampleTestBaseV3):
|
||||
class CellsSampleJsonTest(api_sample_base.ApiSampleTestBaseV21):
|
||||
extension_name = "os-cells"
|
||||
|
||||
def _get_flags(self):
|
||||
|
@ -22,7 +22,7 @@ CONF.import_opt('osapi_compute_extension',
|
||||
'nova.api.openstack.compute.legacy_v2.extensions')
|
||||
|
||||
|
||||
class CertificatesSamplesJsonTest(api_sample_base.ApiSampleTestBaseV3):
|
||||
class CertificatesSamplesJsonTest(api_sample_base.ApiSampleTestBaseV21):
|
||||
extension_name = "os-certificates"
|
||||
|
||||
def _get_flags(self):
|
||||
|
@ -28,7 +28,7 @@ CONF.import_opt('osapi_compute_extension',
|
||||
'nova.api.openstack.compute.legacy_v2.extensions')
|
||||
|
||||
|
||||
class CloudPipeSampleTest(api_sample_base.ApiSampleTestBaseV3):
|
||||
class CloudPipeSampleTest(api_sample_base.ApiSampleTestBaseV21):
|
||||
ADMIN_API = True
|
||||
extension_name = "os-cloudpipe"
|
||||
|
||||
|
@ -30,7 +30,7 @@ def fake_soft_extension_authorizer(extension_name, core=False):
|
||||
return authorize
|
||||
|
||||
|
||||
class ExtensionInfoAllSamplesJsonTest(api_sample_base.ApiSampleTestBaseV3):
|
||||
class ExtensionInfoAllSamplesJsonTest(api_sample_base.ApiSampleTestBaseV21):
|
||||
all_extensions = True
|
||||
|
||||
@mock.patch.object(api_extensions, 'os_compute_soft_authorizer')
|
||||
@ -44,7 +44,7 @@ class ExtensionInfoAllSamplesJsonTest(api_sample_base.ApiSampleTestBaseV3):
|
||||
self._verify_response(template, subs, response, 200)
|
||||
|
||||
|
||||
class ExtensionInfoSamplesJsonTest(api_sample_base.ApiSampleTestBaseV3):
|
||||
class ExtensionInfoSamplesJsonTest(api_sample_base.ApiSampleTestBaseV21):
|
||||
sample_dir = "extension-info"
|
||||
extra_extensions_to_load = ["os-create-backup"]
|
||||
# NOTE (gmann): run this tests for v21. and v2.1 compatible mode only
|
||||
|
@ -21,7 +21,7 @@ CONF.import_opt('osapi_compute_extension',
|
||||
'nova.api.openstack.compute.legacy_v2.extensions')
|
||||
|
||||
|
||||
class FlavorAccessSampleJsonTests(api_sample_base.ApiSampleTestBaseV3):
|
||||
class FlavorAccessSampleJsonTests(api_sample_base.ApiSampleTestBaseV21):
|
||||
ADMIN_API = True
|
||||
extension_name = 'flavor-access'
|
||||
|
||||
|
@ -22,7 +22,7 @@ CONF.import_opt('osapi_compute_extension',
|
||||
'nova.api.openstack.compute.legacy_v2.extensions')
|
||||
|
||||
|
||||
class FlavorExtraSpecsSampleJsonTests(api_sample_base.ApiSampleTestBaseV3):
|
||||
class FlavorExtraSpecsSampleJsonTests(api_sample_base.ApiSampleTestBaseV21):
|
||||
ADMIN_API = True
|
||||
extension_name = 'flavor-extra-specs'
|
||||
|
||||
|
@ -22,7 +22,7 @@ CONF.import_opt('osapi_compute_extension',
|
||||
'nova.api.openstack.compute.legacy_v2.extensions')
|
||||
|
||||
|
||||
class FlavorManageSampleJsonTests(api_sample_base.ApiSampleTestBaseV3):
|
||||
class FlavorManageSampleJsonTests(api_sample_base.ApiSampleTestBaseV21):
|
||||
ADMIN_API = True
|
||||
extension_name = 'flavor-manage'
|
||||
|
||||
|
@ -22,7 +22,7 @@ CONF.import_opt('osapi_compute_extension',
|
||||
'nova.api.openstack.compute.legacy_v2.extensions')
|
||||
|
||||
|
||||
class FlavorRxtxJsonTest(api_sample_base.ApiSampleTestBaseV3):
|
||||
class FlavorRxtxJsonTest(api_sample_base.ApiSampleTestBaseV21):
|
||||
ADMIN_API = True
|
||||
extension_name = 'os-flavor-rxtx'
|
||||
|
||||
|
@ -22,7 +22,7 @@ CONF.import_opt('osapi_compute_extension',
|
||||
'nova.api.openstack.compute.legacy_v2.extensions')
|
||||
|
||||
|
||||
class FlavorsSampleJsonTest(api_sample_base.ApiSampleTestBaseV3):
|
||||
class FlavorsSampleJsonTest(api_sample_base.ApiSampleTestBaseV21):
|
||||
sample_dir = 'flavors'
|
||||
|
||||
def _get_flags(self):
|
||||
|
@ -21,7 +21,7 @@ CONF.import_opt('osapi_compute_extension',
|
||||
'nova.api.openstack.compute.legacy_v2.extensions')
|
||||
|
||||
|
||||
class FloatingIpDNSTest(api_sample_base.ApiSampleTestBaseV3):
|
||||
class FloatingIpDNSTest(api_sample_base.ApiSampleTestBaseV21):
|
||||
ADMIN_API = True
|
||||
extension_name = "os-floating-ip-dns"
|
||||
|
||||
|
@ -22,7 +22,7 @@ CONF.import_opt('osapi_compute_extension',
|
||||
'nova.api.openstack.compute.legacy_v2.extensions')
|
||||
|
||||
|
||||
class FloatingIPPoolsSampleTests(api_sample_base.ApiSampleTestBaseV3):
|
||||
class FloatingIPPoolsSampleTests(api_sample_base.ApiSampleTestBaseV21):
|
||||
extension_name = "os-floating-ip-pools"
|
||||
|
||||
def _get_flags(self):
|
||||
|
@ -25,7 +25,7 @@ CONF.import_opt('osapi_compute_extension',
|
||||
'nova.api.openstack.compute.legacy_v2.extensions')
|
||||
|
||||
|
||||
class FloatingIpsTest(api_sample_base.ApiSampleTestBaseV3):
|
||||
class FloatingIpsTest(api_sample_base.ApiSampleTestBaseV21):
|
||||
extension_name = "os-floating-ips"
|
||||
|
||||
def _get_flags(self):
|
||||
|
@ -25,7 +25,7 @@ CONF.import_opt('osapi_compute_extension',
|
||||
'nova.api.openstack.compute.legacy_v2.extensions')
|
||||
|
||||
|
||||
class FloatingIpsBulkTest(api_sample_base.ApiSampleTestBaseV3):
|
||||
class FloatingIpsBulkTest(api_sample_base.ApiSampleTestBaseV21):
|
||||
ADMIN_API = True
|
||||
extension_name = "os-floating-ips-bulk"
|
||||
|
||||
|
@ -22,7 +22,7 @@ CONF.import_opt('osapi_compute_extension',
|
||||
'nova.api.openstack.compute.legacy_v2.extensions')
|
||||
|
||||
|
||||
class HostsSampleJsonTest(api_sample_base.ApiSampleTestBaseV3):
|
||||
class HostsSampleJsonTest(api_sample_base.ApiSampleTestBaseV21):
|
||||
ADMIN_API = True
|
||||
extension_name = "os-hosts"
|
||||
|
||||
|
@ -27,7 +27,7 @@ CONF.import_opt('osapi_compute_extension',
|
||||
'nova.api.openstack.compute.legacy_v2.extensions')
|
||||
|
||||
|
||||
class HypervisorsSampleJsonTests(api_sample_base.ApiSampleTestBaseV3):
|
||||
class HypervisorsSampleJsonTests(api_sample_base.ApiSampleTestBaseV21):
|
||||
ADMIN_API = True
|
||||
extension_name = "os-hypervisors"
|
||||
|
||||
@ -114,7 +114,7 @@ class HypervisorsSampleJsonTests(api_sample_base.ApiSampleTestBaseV3):
|
||||
|
||||
|
||||
@mock.patch("nova.servicegroup.API.service_is_up", return_value=True)
|
||||
class HypervisorsCellsSampleJsonTests(api_sample_base.ApiSampleTestBaseV3):
|
||||
class HypervisorsCellsSampleJsonTests(api_sample_base.ApiSampleTestBaseV21):
|
||||
ADMIN_API = True
|
||||
extension_name = "os-hypervisors"
|
||||
|
||||
|
@ -23,7 +23,7 @@ CONF.import_opt('osapi_compute_extension',
|
||||
'nova.api.openstack.compute.legacy_v2.extensions')
|
||||
|
||||
|
||||
class ImageSizeSampleJsonTests(api_sample_base.ApiSampleTestBaseV3):
|
||||
class ImageSizeSampleJsonTests(api_sample_base.ApiSampleTestBaseV21):
|
||||
extension_name = "image-size"
|
||||
extra_extensions_to_load = ["images", "image-metadata"]
|
||||
|
||||
|
@ -23,7 +23,7 @@ CONF.import_opt('osapi_compute_extension',
|
||||
'nova.api.openstack.compute.legacy_v2.extensions')
|
||||
|
||||
|
||||
class ImagesSampleJsonTest(api_sample_base.ApiSampleTestBaseV3):
|
||||
class ImagesSampleJsonTest(api_sample_base.ApiSampleTestBaseV21):
|
||||
extension_name = 'images'
|
||||
extra_extensions_to_load = ["image-metadata"]
|
||||
|
||||
|
@ -30,7 +30,7 @@ CONF.import_opt('osapi_compute_extension',
|
||||
'nova.api.openstack.compute.legacy_v2.extensions')
|
||||
|
||||
|
||||
class ServerActionsSampleJsonTest(api_sample_base.ApiSampleTestBaseV3):
|
||||
class ServerActionsSampleJsonTest(api_sample_base.ApiSampleTestBaseV21):
|
||||
ADMIN_API = True
|
||||
extension_name = 'os-instance-actions'
|
||||
|
||||
|
@ -24,7 +24,7 @@ CONF.import_opt('osapi_compute_extension',
|
||||
'nova.api.openstack.compute.legacy_v2.extensions')
|
||||
|
||||
|
||||
class InstanceUsageAuditLogJsonTest(api_sample_base.ApiSampleTestBaseV3):
|
||||
class InstanceUsageAuditLogJsonTest(api_sample_base.ApiSampleTestBaseV21):
|
||||
ADMIN_API = True
|
||||
extension_name = "os-instance-usage-audit-log"
|
||||
|
||||
|
@ -26,7 +26,7 @@ CONF.import_opt('osapi_compute_extension',
|
||||
'nova.api.openstack.compute.legacy_v2.extensions')
|
||||
|
||||
|
||||
class KeyPairsSampleJsonTest(api_sample_base.ApiSampleTestBaseV3):
|
||||
class KeyPairsSampleJsonTest(api_sample_base.ApiSampleTestBaseV21):
|
||||
request_api_version = None
|
||||
sample_dir = "keypairs"
|
||||
expected_delete_status_code = 202
|
||||
|
@ -22,7 +22,7 @@ CONF.import_opt('osapi_compute_extension',
|
||||
'nova.api.openstack.compute.legacy_v2.extensions')
|
||||
|
||||
|
||||
class LimitsSampleJsonTest(api_sample_base.ApiSampleTestBaseV3):
|
||||
class LimitsSampleJsonTest(api_sample_base.ApiSampleTestBaseV21):
|
||||
ADMIN_API = True
|
||||
extension_name = "limits"
|
||||
|
||||
|
@ -25,7 +25,7 @@ CONF.import_opt('osapi_compute_extension',
|
||||
'nova.api.openstack.compute.legacy_v2.extensions')
|
||||
|
||||
|
||||
class MigrationsSamplesJsonTest(api_sample_base.ApiSampleTestBaseV3):
|
||||
class MigrationsSamplesJsonTest(api_sample_base.ApiSampleTestBaseV21):
|
||||
ADMIN_API = True
|
||||
extension_name = "os-migrations"
|
||||
|
||||
|
@ -24,7 +24,7 @@ CONF.import_opt('osapi_compute_extension',
|
||||
'nova.api.openstack.compute.legacy_v2.extensions')
|
||||
|
||||
|
||||
class NetworksJsonTests(api_sample_base.ApiSampleTestBaseV3):
|
||||
class NetworksJsonTests(api_sample_base.ApiSampleTestBaseV21):
|
||||
ADMIN_API = True
|
||||
extension_name = "os-networks"
|
||||
|
||||
|
@ -23,7 +23,7 @@ CONF.import_opt('osapi_compute_extension',
|
||||
'nova.api.openstack.compute.legacy_v2.extensions')
|
||||
|
||||
|
||||
class NetworksAssociateJsonTests(api_sample_base.ApiSampleTestBaseV3):
|
||||
class NetworksAssociateJsonTests(api_sample_base.ApiSampleTestBaseV21):
|
||||
ADMIN_API = True
|
||||
extension_name = "os-networks-associate"
|
||||
extra_extensions_to_load = ["os-networks"]
|
||||
|
@ -89,7 +89,7 @@ class ExtendedServerPciSampleJsonTest(test_servers.ServersSampleBase):
|
||||
self._verify_response('servers-detail-resp', subs, response, 200)
|
||||
|
||||
|
||||
class ExtendedHyervisorPciSampleJsonTest(api_sample_base.ApiSampleTestBaseV3):
|
||||
class ExtendedHyervisorPciSampleJsonTest(api_sample_base.ApiSampleTestBaseV21):
|
||||
ADMIN_API = True
|
||||
extra_extensions_to_load = ['os-hypervisors']
|
||||
extension_name = 'os-pci'
|
||||
@ -175,7 +175,7 @@ class ExtendedHyervisorPciSampleJsonTest(api_sample_base.ApiSampleTestBaseV3):
|
||||
subs, response, 200)
|
||||
|
||||
|
||||
class PciSampleJsonTest(api_sample_base.ApiSampleTestBaseV3):
|
||||
class PciSampleJsonTest(api_sample_base.ApiSampleTestBaseV21):
|
||||
ADMIN_API = True
|
||||
extension_name = "os-pci"
|
||||
|
||||
|
@ -22,7 +22,7 @@ CONF.import_opt('osapi_compute_extension',
|
||||
'nova.api.openstack.compute.legacy_v2.extensions')
|
||||
|
||||
|
||||
class QuotaClassesSampleJsonTests(api_sample_base.ApiSampleTestBaseV3):
|
||||
class QuotaClassesSampleJsonTests(api_sample_base.ApiSampleTestBaseV21):
|
||||
ADMIN_API = True
|
||||
extension_name = "os-quota-class-sets"
|
||||
set_id = 'test_class'
|
||||
|
@ -22,7 +22,7 @@ CONF.import_opt('osapi_compute_extension',
|
||||
'nova.api.openstack.compute.legacy_v2.extensions')
|
||||
|
||||
|
||||
class QuotaSetsSampleJsonTests(api_sample_base.ApiSampleTestBaseV3):
|
||||
class QuotaSetsSampleJsonTests(api_sample_base.ApiSampleTestBaseV21):
|
||||
ADMIN_API = True
|
||||
extension_name = "os-quota-sets"
|
||||
|
||||
|
@ -25,7 +25,7 @@ CONF.import_opt('osapi_compute_extension',
|
||||
'nova.api.openstack.compute.legacy_v2.extensions')
|
||||
|
||||
|
||||
class SchedulerHintsJsonTest(api_sample_base.ApiSampleTestBaseV3):
|
||||
class SchedulerHintsJsonTest(api_sample_base.ApiSampleTestBaseV21):
|
||||
extension_name = "os-scheduler-hints"
|
||||
|
||||
def _get_flags(self):
|
||||
|
@ -22,7 +22,7 @@ CONF.import_opt('osapi_compute_extension',
|
||||
|
||||
|
||||
class SecurityGroupDefaultRulesSampleJsonTest(
|
||||
api_sample_base.ApiSampleTestBaseV3):
|
||||
api_sample_base.ApiSampleTestBaseV21):
|
||||
ADMIN_API = True
|
||||
extension_name = 'os-security-group-default-rules'
|
||||
|
||||
|
@ -22,7 +22,7 @@ CONF.import_opt('osapi_compute_extension',
|
||||
'nova.api.openstack.compute.legacy_v2.extensions')
|
||||
|
||||
|
||||
class ServerGroupsSampleJsonTest(api_sample_base.ApiSampleTestBaseV3):
|
||||
class ServerGroupsSampleJsonTest(api_sample_base.ApiSampleTestBaseV21):
|
||||
extension_name = "os-server-groups"
|
||||
|
||||
def _get_flags(self):
|
||||
|
@ -23,7 +23,7 @@ CONF.import_opt('osapi_compute_extension',
|
||||
'nova.api.openstack.compute.legacy_v2.extensions')
|
||||
|
||||
|
||||
class ServersSampleBase(api_sample_base.ApiSampleTestBaseV3):
|
||||
class ServersSampleBase(api_sample_base.ApiSampleTestBaseV21):
|
||||
extra_extensions_to_load = ["os-access-ips"]
|
||||
|
||||
def _post_server(self, use_common_server_api_samples=True):
|
||||
|
@ -25,7 +25,7 @@ CONF.import_opt('osapi_compute_extension',
|
||||
'nova.api.openstack.compute.legacy_v2.extensions')
|
||||
|
||||
|
||||
class ServicesJsonTest(api_sample_base.ApiSampleTestBaseV3):
|
||||
class ServicesJsonTest(api_sample_base.ApiSampleTestBaseV21):
|
||||
ADMIN_API = True
|
||||
extension_name = "os-services"
|
||||
request_api_version = None
|
||||
|
@ -28,7 +28,7 @@ CONF.import_opt('osapi_compute_extension',
|
||||
'nova.api.openstack.compute.legacy_v2.extensions')
|
||||
|
||||
|
||||
class TenantNetworksJsonTests(api_sample_base.ApiSampleTestBaseV3):
|
||||
class TenantNetworksJsonTests(api_sample_base.ApiSampleTestBaseV21):
|
||||
ADMIN_API = True
|
||||
extension_name = "os-tenant-networks"
|
||||
|
||||
|
@ -22,7 +22,7 @@ CONF.import_opt('osapi_compute_extension',
|
||||
'nova.api.openstack.compute.legacy_v2.extensions')
|
||||
|
||||
|
||||
class UsedLimitsSamplesJsonTest(api_sample_base.ApiSampleTestBaseV3):
|
||||
class UsedLimitsSamplesJsonTest(api_sample_base.ApiSampleTestBaseV21):
|
||||
ADMIN_API = True
|
||||
extension_name = "os-used-limits"
|
||||
extra_extensions_to_load = ["limits"]
|
||||
|
@ -24,7 +24,7 @@ CONF.import_opt('osapi_compute_extension',
|
||||
'nova.api.openstack.compute.legacy_v2.extensions')
|
||||
|
||||
|
||||
class UserDataJsonTest(api_sample_base.ApiSampleTestBaseV3):
|
||||
class UserDataJsonTest(api_sample_base.ApiSampleTestBaseV21):
|
||||
extension_name = "os-user-data"
|
||||
|
||||
def _get_flags(self):
|
||||
|
@ -16,7 +16,7 @@
|
||||
from nova.tests.functional.api_sample_tests import api_sample_base
|
||||
|
||||
|
||||
class VersionsSampleJsonTest(api_sample_base.ApiSampleTestBaseV3):
|
||||
class VersionsSampleJsonTest(api_sample_base.ApiSampleTestBaseV21):
|
||||
sample_dir = 'versions'
|
||||
scenarios = [('', {'_test': ''})]
|
||||
|
||||
|
@ -34,7 +34,7 @@ CONF.import_opt('osapi_compute_extension',
|
||||
'nova.api.openstack.compute.legacy_v2.extensions')
|
||||
|
||||
|
||||
class SnapshotsSampleJsonTests(api_sample_base.ApiSampleTestBaseV3):
|
||||
class SnapshotsSampleJsonTests(api_sample_base.ApiSampleTestBaseV21):
|
||||
extension_name = "os-volumes"
|
||||
|
||||
create_subs = {
|
||||
|
@ -38,7 +38,7 @@ class MicroversionsTest(test.NoDBTestCase):
|
||||
return res
|
||||
|
||||
@mock.patch("nova.api.openstack.APIRouterV21.api_extension_namespace",
|
||||
return_value='nova.api.v3.test_extensions')
|
||||
return_value='nova.api.v21.test_extensions')
|
||||
def test_microversions_no_header(self, mock_namespace):
|
||||
app = fakes.wsgi_app_v21(init_only='test-microversions')
|
||||
req = fakes.HTTPRequest.blank('/v2/fake/microversions')
|
||||
@ -48,7 +48,7 @@ class MicroversionsTest(test.NoDBTestCase):
|
||||
self.assertEqual('val', resp_json['param'])
|
||||
|
||||
@mock.patch("nova.api.openstack.APIRouterV21.api_extension_namespace",
|
||||
return_value='nova.api.v3.test_extensions')
|
||||
return_value='nova.api.v21.test_extensions')
|
||||
def test_microversions_return_header(self, mock_namespace):
|
||||
app = fakes.wsgi_app_v21(init_only='test-microversions')
|
||||
req = fakes.HTTPRequest.blank('/v2/fake/microversions')
|
||||
@ -61,7 +61,7 @@ class MicroversionsTest(test.NoDBTestCase):
|
||||
|
||||
@mock.patch("nova.api.openstack.api_version_request.max_api_version")
|
||||
@mock.patch("nova.api.openstack.APIRouterV21.api_extension_namespace",
|
||||
return_value='nova.api.v3.test_extensions')
|
||||
return_value='nova.api.v21.test_extensions')
|
||||
def test_microversions_return_header_non_default(self, mock_namespace,
|
||||
mock_maxver):
|
||||
mock_maxver.return_value = api_version.APIVersionRequest("2.3")
|
||||
@ -78,7 +78,7 @@ class MicroversionsTest(test.NoDBTestCase):
|
||||
|
||||
@mock.patch("nova.api.openstack.api_version_request.max_api_version")
|
||||
@mock.patch("nova.api.openstack.APIRouterV21.api_extension_namespace",
|
||||
return_value='nova.api.v3.test_extensions')
|
||||
return_value='nova.api.v21.test_extensions')
|
||||
def test_microversions_return_header_fault(self, mock_namespace,
|
||||
mock_maxver):
|
||||
mock_maxver.return_value = api_version.APIVersionRequest("3.0")
|
||||
@ -93,7 +93,7 @@ class MicroversionsTest(test.NoDBTestCase):
|
||||
|
||||
@mock.patch("nova.api.openstack.api_version_request.max_api_version")
|
||||
@mock.patch("nova.api.openstack.APIRouterV21.api_extension_namespace",
|
||||
return_value='nova.api.v3.test_extensions')
|
||||
return_value='nova.api.v21.test_extensions')
|
||||
def _check_microversion_response(self, url, req_version, resp_param,
|
||||
mock_namespace, mock_maxver):
|
||||
mock_maxver.return_value = api_version.APIVersionRequest('2.3')
|
||||
@ -120,7 +120,7 @@ class MicroversionsTest(test.NoDBTestCase):
|
||||
|
||||
@mock.patch("nova.api.openstack.api_version_request.max_api_version")
|
||||
@mock.patch("nova.api.openstack.APIRouterV21.api_extension_namespace",
|
||||
return_value='nova.api.v3.test_extensions')
|
||||
return_value='nova.api.v21.test_extensions')
|
||||
def test_microversions2_later_version(self, mock_namespace, mock_maxver):
|
||||
mock_maxver.return_value = api_version.APIVersionRequest("3.1")
|
||||
|
||||
@ -134,7 +134,7 @@ class MicroversionsTest(test.NoDBTestCase):
|
||||
|
||||
@mock.patch("nova.api.openstack.api_version_request.max_api_version")
|
||||
@mock.patch("nova.api.openstack.APIRouterV21.api_extension_namespace",
|
||||
return_value='nova.api.v3.test_extensions')
|
||||
return_value='nova.api.v21.test_extensions')
|
||||
def test_microversions2_version_too_high(self, mock_namespace,
|
||||
mock_maxver):
|
||||
mock_maxver.return_value = api_version.APIVersionRequest("3.5")
|
||||
@ -146,7 +146,7 @@ class MicroversionsTest(test.NoDBTestCase):
|
||||
self.assertEqual(404, res.status_int)
|
||||
|
||||
@mock.patch("nova.api.openstack.APIRouterV21.api_extension_namespace",
|
||||
return_value='nova.api.v3.test_extensions')
|
||||
return_value='nova.api.v21.test_extensions')
|
||||
def test_microversions2_version_too_low(self, mock_namespace):
|
||||
app = fakes.wsgi_app_v21(init_only='test-microversions')
|
||||
req = fakes.HTTPRequest.blank('/v2/fake/microversions2')
|
||||
@ -156,7 +156,7 @@ class MicroversionsTest(test.NoDBTestCase):
|
||||
|
||||
@mock.patch("nova.api.openstack.api_version_request.max_api_version")
|
||||
@mock.patch("nova.api.openstack.APIRouterV21.api_extension_namespace",
|
||||
return_value='nova.api.v3.test_extensions')
|
||||
return_value='nova.api.v21.test_extensions')
|
||||
def test_microversions_global_version_too_high(self, mock_namespace,
|
||||
mock_maxver):
|
||||
mock_maxver.return_value = api_version.APIVersionRequest("3.5")
|
||||
@ -173,7 +173,7 @@ class MicroversionsTest(test.NoDBTestCase):
|
||||
|
||||
@mock.patch("nova.api.openstack.api_version_request.max_api_version")
|
||||
@mock.patch("nova.api.openstack.APIRouterV21.api_extension_namespace",
|
||||
return_value='nova.api.v3.test_extensions')
|
||||
return_value='nova.api.v21.test_extensions')
|
||||
def test_microversions_schema(self, mock_namespace, mock_maxver):
|
||||
mock_maxver.return_value = api_version.APIVersionRequest("3.3")
|
||||
|
||||
@ -193,7 +193,7 @@ class MicroversionsTest(test.NoDBTestCase):
|
||||
|
||||
@mock.patch("nova.api.openstack.api_version_request.max_api_version")
|
||||
@mock.patch("nova.api.openstack.APIRouterV21.api_extension_namespace",
|
||||
return_value='nova.api.v3.test_extensions')
|
||||
return_value='nova.api.v21.test_extensions')
|
||||
def test_microversions_schema_fail(self, mock_namespace, mock_maxver):
|
||||
mock_maxver.return_value = api_version.APIVersionRequest("3.3")
|
||||
|
||||
@ -212,7 +212,7 @@ class MicroversionsTest(test.NoDBTestCase):
|
||||
|
||||
@mock.patch("nova.api.openstack.api_version_request.max_api_version")
|
||||
@mock.patch("nova.api.openstack.APIRouterV21.api_extension_namespace",
|
||||
return_value='nova.api.v3.test_extensions')
|
||||
return_value='nova.api.v21.test_extensions')
|
||||
def test_microversions_schema_out_of_version_check(self, mock_namespace,
|
||||
mock_maxver):
|
||||
mock_maxver.return_value = api_version.APIVersionRequest("3.3")
|
||||
@ -232,7 +232,7 @@ class MicroversionsTest(test.NoDBTestCase):
|
||||
|
||||
@mock.patch("nova.api.openstack.api_version_request.max_api_version")
|
||||
@mock.patch("nova.api.openstack.APIRouterV21.api_extension_namespace",
|
||||
return_value='nova.api.v3.test_extensions')
|
||||
return_value='nova.api.v21.test_extensions')
|
||||
def test_microversions_schema_second_version(self, mock_namespace,
|
||||
mock_maxver):
|
||||
mock_maxver.return_value = api_version.APIVersionRequest("3.3")
|
||||
@ -252,7 +252,7 @@ class MicroversionsTest(test.NoDBTestCase):
|
||||
|
||||
@mock.patch("nova.api.openstack.api_version_request.max_api_version")
|
||||
@mock.patch("nova.api.openstack.APIRouterV21.api_extension_namespace",
|
||||
return_value='nova.api.v3.test_extensions')
|
||||
return_value='nova.api.v21.test_extensions')
|
||||
def _test_microversions_inner_function(self, version, expected_resp,
|
||||
mock_namespace,
|
||||
mock_maxver):
|
||||
@ -277,7 +277,7 @@ class MicroversionsTest(test.NoDBTestCase):
|
||||
|
||||
@mock.patch("nova.api.openstack.api_version_request.max_api_version")
|
||||
@mock.patch("nova.api.openstack.APIRouterV21.api_extension_namespace",
|
||||
return_value='nova.api.v3.test_extensions')
|
||||
return_value='nova.api.v21.test_extensions')
|
||||
def test_with_extends_decorator(self, mock_namespace, mock_maxver):
|
||||
mock_maxver.return_value = api_version.APIVersionRequest('2.4')
|
||||
|
||||
@ -300,7 +300,7 @@ class MicroversionsTest(test.NoDBTestCase):
|
||||
|
||||
@mock.patch("nova.api.openstack.api_version_request.max_api_version")
|
||||
@mock.patch("nova.api.openstack.APIRouterV21.api_extension_namespace",
|
||||
return_value='nova.api.v3.test_extensions')
|
||||
return_value='nova.api.v21.test_extensions')
|
||||
def _test_microversions_actions(self, ret_code, ret_header, req_header,
|
||||
mock_namespace,
|
||||
mock_maxver):
|
||||
|
@ -26,7 +26,7 @@ class PluginTest(test.NoDBTestCase):
|
||||
|
||||
@mock.patch("nova.api.openstack.APIRouterV21.api_extension_namespace")
|
||||
def test_plugin_framework_index(self, mock_namespace):
|
||||
mock_namespace.return_value = 'nova.api.v3.test_extensions'
|
||||
mock_namespace.return_value = 'nova.api.v21.test_extensions'
|
||||
|
||||
app = fakes.wsgi_app_v21(init_only='test-basic')
|
||||
req = fakes.HTTPRequest.blank('/v2/fake/test')
|
||||
|
@ -1,194 +0,0 @@
|
||||
# Copyright 2013 IBM Corp.
|
||||
#
|
||||
# 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
|
||||
import stevedore
|
||||
import webob.exc
|
||||
|
||||
from nova.api import openstack
|
||||
from nova.api.openstack import compute
|
||||
from nova.api.openstack.compute import extension_info
|
||||
from nova.api.openstack import extensions
|
||||
from nova import exception
|
||||
from nova import test
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
||||
class fake_bad_extension(object):
|
||||
name = "fake_bad_extension"
|
||||
alias = "fake-bad"
|
||||
|
||||
|
||||
class fake_stevedore_enabled_extensions(object):
|
||||
def __init__(self, namespace, check_func, invoke_on_load=False,
|
||||
invoke_args=(), invoke_kwds=None):
|
||||
self.extensions = []
|
||||
|
||||
def map(self, func, *args, **kwds):
|
||||
pass
|
||||
|
||||
def __iter__(self):
|
||||
return iter(self.extensions)
|
||||
|
||||
|
||||
class fake_loaded_extension_info(object):
|
||||
def __init__(self):
|
||||
self.extensions = {}
|
||||
|
||||
def register_extension(self, ext):
|
||||
self.extensions[ext] = ext
|
||||
return True
|
||||
|
||||
def get_extensions(self):
|
||||
return {'core1': None, 'core2': None, 'noncore1': None}
|
||||
|
||||
|
||||
class ExtensionLoadingTestCase(test.NoDBTestCase):
|
||||
|
||||
def _set_v3_core(self, core_extensions):
|
||||
openstack.API_V3_CORE_EXTENSIONS = core_extensions
|
||||
|
||||
def test_extensions_loaded(self):
|
||||
app = compute.APIRouterV3()
|
||||
self.assertIn('servers', app._loaded_extension_info.extensions)
|
||||
|
||||
def test_check_bad_extension(self):
|
||||
loaded_ext_info = extension_info.LoadedExtensionInfo()
|
||||
self.assertFalse(loaded_ext_info._check_extension(fake_bad_extension))
|
||||
|
||||
def test_extensions_blacklist(self):
|
||||
app = compute.APIRouterV3()
|
||||
self.assertIn('os-hosts', app._loaded_extension_info.extensions)
|
||||
CONF.set_override('extensions_blacklist', ['os-hosts'], 'osapi_v21')
|
||||
app = compute.APIRouterV3()
|
||||
self.assertNotIn('os-hosts', app._loaded_extension_info.extensions)
|
||||
|
||||
def test_extensions_whitelist_accept(self):
|
||||
# NOTE(maurosr): just to avoid to get an exception raised for not
|
||||
# loading all core api.
|
||||
v3_core = openstack.API_V3_CORE_EXTENSIONS
|
||||
openstack.API_V3_CORE_EXTENSIONS = set(['servers'])
|
||||
self.addCleanup(self._set_v3_core, v3_core)
|
||||
|
||||
app = compute.APIRouterV3()
|
||||
self.assertIn('os-hosts', app._loaded_extension_info.extensions)
|
||||
CONF.set_override('extensions_whitelist', ['servers', 'os-hosts'],
|
||||
'osapi_v21')
|
||||
app = compute.APIRouterV3()
|
||||
self.assertIn('os-hosts', app._loaded_extension_info.extensions)
|
||||
|
||||
def test_extensions_whitelist_block(self):
|
||||
# NOTE(maurosr): just to avoid to get an exception raised for not
|
||||
# loading all core api.
|
||||
v3_core = openstack.API_V3_CORE_EXTENSIONS
|
||||
openstack.API_V3_CORE_EXTENSIONS = set(['servers'])
|
||||
self.addCleanup(self._set_v3_core, v3_core)
|
||||
|
||||
app = compute.APIRouterV3()
|
||||
self.assertIn('os-hosts', app._loaded_extension_info.extensions)
|
||||
CONF.set_override('extensions_whitelist', ['servers'], 'osapi_v21')
|
||||
app = compute.APIRouterV3()
|
||||
self.assertNotIn('os-hosts', app._loaded_extension_info.extensions)
|
||||
|
||||
def test_blacklist_overrides_whitelist(self):
|
||||
# NOTE(maurosr): just to avoid to get an exception raised for not
|
||||
# loading all core api.
|
||||
v3_core = openstack.API_V3_CORE_EXTENSIONS
|
||||
openstack.API_V3_CORE_EXTENSIONS = set(['servers'])
|
||||
self.addCleanup(self._set_v3_core, v3_core)
|
||||
|
||||
app = compute.APIRouterV3()
|
||||
self.assertIn('os-hosts', app._loaded_extension_info.extensions)
|
||||
CONF.set_override('extensions_whitelist', ['servers', 'os-hosts'],
|
||||
'osapi_v21')
|
||||
CONF.set_override('extensions_blacklist', ['os-hosts'], 'osapi_v21')
|
||||
app = compute.APIRouterV3()
|
||||
self.assertNotIn('os-hosts', app._loaded_extension_info.extensions)
|
||||
self.assertIn('servers', app._loaded_extension_info.extensions)
|
||||
self.assertEqual(len(app._loaded_extension_info.extensions), 1)
|
||||
|
||||
def test_get_missing_core_extensions(self):
|
||||
v3_core = openstack.API_V3_CORE_EXTENSIONS
|
||||
openstack.API_V3_CORE_EXTENSIONS = set(['core1', 'core2'])
|
||||
self.addCleanup(self._set_v3_core, v3_core)
|
||||
self.assertEqual(len(compute.APIRouterV3.get_missing_core_extensions(
|
||||
['core1', 'core2', 'noncore1'])), 0)
|
||||
missing_core = compute.APIRouterV3.get_missing_core_extensions(
|
||||
['core1'])
|
||||
self.assertEqual(len(missing_core), 1)
|
||||
self.assertIn('core2', missing_core)
|
||||
missing_core = compute.APIRouterV3.get_missing_core_extensions([])
|
||||
self.assertEqual(len(missing_core), 2)
|
||||
self.assertIn('core1', missing_core)
|
||||
self.assertIn('core2', missing_core)
|
||||
missing_core = compute.APIRouterV3.get_missing_core_extensions(
|
||||
['noncore1'])
|
||||
self.assertEqual(len(missing_core), 2)
|
||||
self.assertIn('core1', missing_core)
|
||||
self.assertIn('core2', missing_core)
|
||||
|
||||
def test_core_extensions_present(self):
|
||||
self.stubs.Set(stevedore.enabled, 'EnabledExtensionManager',
|
||||
fake_stevedore_enabled_extensions)
|
||||
self.stubs.Set(extension_info, 'LoadedExtensionInfo',
|
||||
fake_loaded_extension_info)
|
||||
v3_core = openstack.API_V3_CORE_EXTENSIONS
|
||||
openstack.API_V3_CORE_EXTENSIONS = set(['core1', 'core2'])
|
||||
self.addCleanup(self._set_v3_core, v3_core)
|
||||
# if no core API extensions are missing then an exception will
|
||||
# not be raised when creating an instance of compute.APIRouterV3
|
||||
compute.APIRouterV3()
|
||||
|
||||
def test_core_extensions_missing(self):
|
||||
self.stubs.Set(stevedore.enabled, 'EnabledExtensionManager',
|
||||
fake_stevedore_enabled_extensions)
|
||||
self.stubs.Set(extension_info, 'LoadedExtensionInfo',
|
||||
fake_loaded_extension_info)
|
||||
self.assertRaises(exception.CoreAPIMissing, compute.APIRouterV3)
|
||||
|
||||
def test_extensions_expected_error(self):
|
||||
@extensions.expected_errors(404)
|
||||
def fake_func():
|
||||
raise webob.exc.HTTPNotFound()
|
||||
|
||||
self.assertRaises(webob.exc.HTTPNotFound, fake_func)
|
||||
|
||||
def test_extensions_expected_error_from_list(self):
|
||||
@extensions.expected_errors((404, 403))
|
||||
def fake_func():
|
||||
raise webob.exc.HTTPNotFound()
|
||||
|
||||
self.assertRaises(webob.exc.HTTPNotFound, fake_func)
|
||||
|
||||
def test_extensions_unexpected_error(self):
|
||||
@extensions.expected_errors(404)
|
||||
def fake_func():
|
||||
raise webob.exc.HTTPConflict()
|
||||
|
||||
self.assertRaises(webob.exc.HTTPInternalServerError, fake_func)
|
||||
|
||||
def test_extensions_unexpected_error_from_list(self):
|
||||
@extensions.expected_errors((404, 413))
|
||||
def fake_func():
|
||||
raise webob.exc.HTTPConflict()
|
||||
|
||||
self.assertRaises(webob.exc.HTTPInternalServerError, fake_func)
|
||||
|
||||
def test_extensions_unexpected_policy_not_authorized_error(self):
|
||||
@extensions.expected_errors(404)
|
||||
def fake_func():
|
||||
raise exception.PolicyNotAuthorized(action="foo")
|
||||
|
||||
self.assertRaises(exception.PolicyNotAuthorized, fake_func)
|
@ -73,53 +73,53 @@ class APIVersionRequestTests(test.NoDBTestCase):
|
||||
api_version_request.APIVersionRequest, "2.1 ")
|
||||
|
||||
def test_version_comparisons(self):
|
||||
v1 = api_version_request.APIVersionRequest("2.0")
|
||||
v2 = api_version_request.APIVersionRequest("2.5")
|
||||
v3 = api_version_request.APIVersionRequest("5.23")
|
||||
v4 = api_version_request.APIVersionRequest("2.0")
|
||||
vers1 = api_version_request.APIVersionRequest("2.0")
|
||||
vers2 = api_version_request.APIVersionRequest("2.5")
|
||||
vers3 = api_version_request.APIVersionRequest("5.23")
|
||||
vers4 = api_version_request.APIVersionRequest("2.0")
|
||||
v_null = api_version_request.APIVersionRequest()
|
||||
|
||||
self.assertTrue(v_null < v2)
|
||||
self.assertTrue(v1 < v2)
|
||||
self.assertTrue(v1 <= v2)
|
||||
self.assertTrue(v1 <= v4)
|
||||
self.assertTrue(v2 > v_null)
|
||||
self.assertTrue(v3 > v2)
|
||||
self.assertTrue(v1 >= v4)
|
||||
self.assertTrue(v3 >= v2)
|
||||
self.assertTrue(v1 != v2)
|
||||
self.assertTrue(v1 == v4)
|
||||
self.assertTrue(v1 != v_null)
|
||||
self.assertTrue(v_null < vers2)
|
||||
self.assertTrue(vers1 < vers2)
|
||||
self.assertTrue(vers1 <= vers2)
|
||||
self.assertTrue(vers1 <= vers4)
|
||||
self.assertTrue(vers2 > v_null)
|
||||
self.assertTrue(vers3 > vers2)
|
||||
self.assertTrue(vers1 >= vers4)
|
||||
self.assertTrue(vers3 >= vers2)
|
||||
self.assertTrue(vers1 != vers2)
|
||||
self.assertTrue(vers1 == vers4)
|
||||
self.assertTrue(vers1 != v_null)
|
||||
self.assertTrue(v_null == v_null)
|
||||
self.assertRaises(TypeError, v1.__lt__, "2.1")
|
||||
self.assertRaises(TypeError, vers1.__lt__, "2.1")
|
||||
|
||||
def test_version_matches(self):
|
||||
v1 = api_version_request.APIVersionRequest("2.0")
|
||||
v2 = api_version_request.APIVersionRequest("2.5")
|
||||
v3 = api_version_request.APIVersionRequest("2.45")
|
||||
v4 = api_version_request.APIVersionRequest("3.3")
|
||||
v5 = api_version_request.APIVersionRequest("3.23")
|
||||
v6 = api_version_request.APIVersionRequest("2.0")
|
||||
v7 = api_version_request.APIVersionRequest("3.3")
|
||||
v8 = api_version_request.APIVersionRequest("4.0")
|
||||
vers1 = api_version_request.APIVersionRequest("2.0")
|
||||
vers2 = api_version_request.APIVersionRequest("2.5")
|
||||
vers3 = api_version_request.APIVersionRequest("2.45")
|
||||
vers4 = api_version_request.APIVersionRequest("3.3")
|
||||
vers5 = api_version_request.APIVersionRequest("3.23")
|
||||
vers6 = api_version_request.APIVersionRequest("2.0")
|
||||
vers7 = api_version_request.APIVersionRequest("3.3")
|
||||
vers8 = api_version_request.APIVersionRequest("4.0")
|
||||
v_null = api_version_request.APIVersionRequest()
|
||||
|
||||
self.assertTrue(v2.matches(v1, v3))
|
||||
self.assertTrue(v2.matches(v1, v_null))
|
||||
self.assertTrue(v1.matches(v6, v2))
|
||||
self.assertTrue(v4.matches(v2, v7))
|
||||
self.assertTrue(v4.matches(v_null, v7))
|
||||
self.assertTrue(v4.matches(v_null, v8))
|
||||
self.assertFalse(v1.matches(v2, v3))
|
||||
self.assertFalse(v5.matches(v2, v4))
|
||||
self.assertFalse(v2.matches(v3, v1))
|
||||
self.assertTrue(vers2.matches(vers1, vers3))
|
||||
self.assertTrue(vers2.matches(vers1, v_null))
|
||||
self.assertTrue(vers1.matches(vers6, vers2))
|
||||
self.assertTrue(vers4.matches(vers2, vers7))
|
||||
self.assertTrue(vers4.matches(v_null, vers7))
|
||||
self.assertTrue(vers4.matches(v_null, vers8))
|
||||
self.assertFalse(vers1.matches(vers2, vers3))
|
||||
self.assertFalse(vers5.matches(vers2, vers4))
|
||||
self.assertFalse(vers2.matches(vers3, vers1))
|
||||
|
||||
self.assertRaises(ValueError, v_null.matches, v1, v3)
|
||||
self.assertRaises(ValueError, v_null.matches, vers1, vers3)
|
||||
|
||||
def test_get_string(self):
|
||||
v1_string = "3.23"
|
||||
v1 = api_version_request.APIVersionRequest(v1_string)
|
||||
self.assertEqual(v1_string, v1.get_string())
|
||||
vers1_string = "3.23"
|
||||
vers1 = api_version_request.APIVersionRequest(vers1_string)
|
||||
self.assertEqual(vers1_string, vers1.get_string())
|
||||
|
||||
self.assertRaises(ValueError,
|
||||
api_version_request.APIVersionRequest().get_string)
|
||||
|
14
setup.cfg
14
setup.cfg
@ -69,7 +69,7 @@ console_scripts =
|
||||
nova-spicehtml5proxy = nova.cmd.spicehtml5proxy:main
|
||||
nova-xvpvncproxy = nova.cmd.xvpvncproxy:main
|
||||
|
||||
nova.api.v3.extensions =
|
||||
nova.api.v21.extensions =
|
||||
access_ips = nova.api.openstack.compute.access_ips:AccessIPs
|
||||
admin_actions = nova.api.openstack.compute.admin_actions:AdminActions
|
||||
admin_password = nova.api.openstack.compute.admin_password:AdminPassword
|
||||
@ -156,7 +156,7 @@ nova.api.v3.extensions =
|
||||
virtual_interfaces = nova.api.openstack.compute.virtual_interfaces:VirtualInterfaces
|
||||
volumes = nova.api.openstack.compute.volumes:Volumes
|
||||
|
||||
nova.api.v3.extensions.server.create =
|
||||
nova.api.v21.extensions.server.create =
|
||||
access_ips = nova.api.openstack.compute.access_ips:AccessIPs
|
||||
availability_zone = nova.api.openstack.compute.availability_zone:AvailabilityZone
|
||||
block_device_mapping = nova.api.openstack.compute.block_device_mapping:BlockDeviceMapping
|
||||
@ -170,20 +170,20 @@ nova.api.v3.extensions.server.create =
|
||||
security_groups = nova.api.openstack.compute.security_groups:SecurityGroups
|
||||
user_data = nova.api.openstack.compute.user_data:UserData
|
||||
|
||||
nova.api.v3.extensions.server.rebuild =
|
||||
nova.api.v21.extensions.server.rebuild =
|
||||
access_ips = nova.api.openstack.compute.access_ips:AccessIPs
|
||||
disk_config = nova.api.openstack.compute.disk_config:DiskConfig
|
||||
personality = nova.api.openstack.compute.personality:Personality
|
||||
preserve_ephemeral_rebuild = nova.api.openstack.compute.preserve_ephemeral_rebuild:PreserveEphemeralRebuild
|
||||
|
||||
nova.api.v3.extensions.server.update =
|
||||
nova.api.v21.extensions.server.update =
|
||||
access_ips = nova.api.openstack.compute.access_ips:AccessIPs
|
||||
disk_config = nova.api.openstack.compute.disk_config:DiskConfig
|
||||
|
||||
nova.api.v3.extensions.server.resize =
|
||||
disk_config = nova.api.openstack.compute.disk_config:DiskConfig
|
||||
nova.api.v21.extensions.server.resize =
|
||||
disk_config = nova.api.openstack.compute.disk_config:DiskConfig
|
||||
|
||||
nova.api.v3.test_extensions =
|
||||
nova.api.v21.test_extensions =
|
||||
basic = nova.tests.unit.api.openstack.compute.basic:Basic
|
||||
microversions = nova.tests.unit.api.openstack.compute.microversions:Microversions
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user