Merge "Select block-storage as service type"
This commit is contained in:
commit
90bd2c4c39
|
@ -16,6 +16,16 @@ Changelog
|
|||
.. Release notes for existing releases are MUTABLE! If there is something that
|
||||
was missed or can be improved, feel free to change it!
|
||||
|
||||
Unreleased
|
||||
----------
|
||||
|
||||
Changed
|
||||
~~~~~~~
|
||||
|
||||
* A new unversioned service type **block-storage** is used as a default for
|
||||
Cinder service. To use another service type, use ``api_versions@openstack``
|
||||
context or ``api_info`` property of environment configuration.
|
||||
|
||||
[1.4.0] - 2019-03-07
|
||||
--------------------
|
||||
|
||||
|
@ -35,7 +45,7 @@ Added
|
|||
* [scenario plugin] BarbicanSecrets.create_and_get
|
||||
* [scenario plugin] BarbicanSecrets.get
|
||||
* [scenario plugin] BarbicanSecrets.create_and_list
|
||||
* [scenario plugin] BarbicanSecrets.create_symmetric_and_delete
|
||||
* [scenario plugin] BarbicanSecrets.create_symmetric_and_delete
|
||||
* Added octavia scenarios
|
||||
* [scenario plugin] Octavia.create_and_list_loadbalancers
|
||||
* [scenario plugin] Octavia.create_and_delete_loadbalancers
|
||||
|
|
|
@ -74,6 +74,7 @@ class _Service(utils.ImmutableMixin, utils.EnumMixin):
|
|||
class _ServiceType(utils.ImmutableMixin, utils.EnumMixin):
|
||||
"""OpenStack services types, mapped to service names."""
|
||||
|
||||
BLOCK_STORAGE = "block-storage"
|
||||
VOLUME = "volume"
|
||||
VOLUMEV2 = "volumev2"
|
||||
VOLUMEV3 = "volumev3"
|
||||
|
@ -107,9 +108,12 @@ class _ServiceType(utils.ImmutableMixin, utils.EnumMixin):
|
|||
self.__names = {
|
||||
self.CLUSTERING: _Service.SENLIN,
|
||||
self.COMPUTE: _Service.NOVA,
|
||||
# unversioned endpoint of Cinder
|
||||
self.BLOCK_STORAGE: _Service.CINDER,
|
||||
# legacy versioned endpoints of Cinder
|
||||
self.VOLUME: _Service.CINDER,
|
||||
self.VOLUMEV2: _Service.CINDERV2,
|
||||
self.VOLUMEV3: _Service.CINDERV3,
|
||||
self.VOLUMEV2: _Service.CINDER,
|
||||
self.VOLUMEV3: _Service.CINDER,
|
||||
self.SHARE: _Service.MANILA,
|
||||
self.EC2: _Service.EC2,
|
||||
self.IMAGE: _Service.GLANCE,
|
||||
|
|
|
@ -508,7 +508,7 @@ class Heat(OSClient):
|
|||
return client
|
||||
|
||||
|
||||
@configure("cinder", default_version="3", default_service_type="volumev3",
|
||||
@configure("cinder", default_version="3", default_service_type="block-storage",
|
||||
supported_versions=["1", "2", "3"])
|
||||
class Cinder(OSClient):
|
||||
"""Wrapper for CinderClient which returns an authenticated native client.
|
||||
|
|
|
@ -463,15 +463,14 @@ class RequiredServicesValidator(validation.Validator):
|
|||
creds = (context.get("admin", {}).get("credential", None)
|
||||
or context["users"][0]["credential"])
|
||||
|
||||
clients = creds.clients()
|
||||
available_services = clients.services().values()
|
||||
|
||||
if "api_versions" in config.get("contexts", {}):
|
||||
api_versions = config["contexts"]["api_versions"]
|
||||
else:
|
||||
api_versions = config.get("contexts", {}).get(
|
||||
"api_versions@openstack", {})
|
||||
|
||||
available_services = creds.clients().services().values()
|
||||
|
||||
for service in self.services:
|
||||
service_config = api_versions.get(service, {})
|
||||
if ("service_type" in service_config
|
||||
|
@ -482,15 +481,11 @@ class RequiredServicesValidator(validation.Validator):
|
|||
continue
|
||||
|
||||
if service not in available_services:
|
||||
service_client = getattr(clients, service)
|
||||
default_st = service_client._meta_get("default_service_type")
|
||||
|
||||
if default_st not in clients.services():
|
||||
self.fail(
|
||||
("'{0}' service is not available. Hint: If '{0}' "
|
||||
"service has non-default service_type, try to setup "
|
||||
"it via 'api_versions@openstack' context."
|
||||
).format(service))
|
||||
self.fail(
|
||||
("'{0}' service is not available. Hint: If '{0}' "
|
||||
"service has non-default service_type, try to setup "
|
||||
"it via 'api_versions@openstack' context."
|
||||
).format(service))
|
||||
|
||||
|
||||
@validation.add("required_platform", platform="openstack", users=True)
|
||||
|
|
Loading…
Reference in New Issue