Select block-storage as service type
block-storage is the official service type for cinder, according to the service-types-authority starting from OpenStack Stein release [1]. It is unversioned endpoint which replaces old 'volume', 'volumev2' and 'volumev3'. Also, this patch changes mapping at rally_openstack.const.ServiceTypes, so all known Cinder service types matche the name of service without version. Specifiying specific service API version to use was never done by using these different versioned constants. Mostly this mapping is done for displaying service catalog via `rally deployment show` and `rally env info`. Another thing here is reverting a part of change [2]. It was a wrong attempt to handle the case of several endpoints of Cinder. [1] https://review.openstack.org/#/c/510939/ [2] https://review.openstack.org/#/c/637947/ Change-Id: Ice18db86267e43421a14660f0e66891be0406fad Signed-off-by: Cédric Ollivier <ollivier.cedric@gmail.com>
This commit is contained in:
parent
1c0d8a0bfa
commit
bd09a3ec4d
@ -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…
x
Reference in New Issue
Block a user