Update our service definition

Clarify that we are the OpenStack Containers service as officially
defined in OpenStack governance [1].

[1] https://git.openstack.org/cgit/openstack/governance/plain/
    reference/projects.yaml

Change-Id: Ibf554b37de55a5fe6f550fade9a5cd91ec67ac7c
This commit is contained in:
Hongbin Lu 2018-02-04 03:06:44 +00:00
parent 7615fba2ae
commit bedba8a484
6 changed files with 38 additions and 38 deletions

View File

@ -54,7 +54,7 @@ Need to adopt tempest.conf, an example as follows::
[oslo_concurrency]
lock_path = /tmp/
[container_management]
[container_service]
catalog_type = container
[debug]

View File

@ -17,12 +17,12 @@ from zun_tempest_plugin.tests.tempest.api import clients
class APIMicroversionFixture(fixtures.Fixture):
def __init__(self, container_management_microversion):
self.container_management_microversion = \
container_management_microversion
def __init__(self, container_service_microversion):
self.container_service_microversion = \
container_service_microversion
def _setUp(self):
super(APIMicroversionFixture, self)._setUp()
clients.set_container_management_api_microversion(
self.container_management_microversion)
self.addCleanup(clients.reset_container_management_api_microversion)
clients.set_container_service_api_microversion(
self.container_service_microversion)
self.addCleanup(clients.reset_container_service_api_microversion)

View File

@ -31,23 +31,23 @@ CONF = config.CONF
ADMIN_CREDS = None
CONTAINER_MANAGEMENT_MICROVERSION = None
CONTAINER_SERVICE_MICROVERSION = None
def get_container_management_api_version():
def get_container_service_api_version():
"""Get zun-api-version with format: 'container X.Y'"""
return 'container ' + CONTAINER_MANAGEMENT_MICROVERSION
return 'container ' + CONTAINER_SERVICE_MICROVERSION
def set_container_management_api_microversion(
container_management_microversion):
global CONTAINER_MANAGEMENT_MICROVERSION
CONTAINER_MANAGEMENT_MICROVERSION = container_management_microversion
def set_container_service_api_microversion(
container_service_microversion):
global CONTAINER_SERVICE_MICROVERSION
CONTAINER_SERVICE_MICROVERSION = container_service_microversion
def reset_container_management_api_microversion():
global CONTAINER_MANAGEMENT_MICROVERSION
CONTAINER_MANAGEMENT_MICROVERSION = None
def reset_container_service_api_microversion():
global CONTAINER_SERVICE_MICROVERSION
CONTAINER_SERVICE_MICROVERSION = None
class Manager(manager.Manager):
@ -82,26 +82,26 @@ class ZunClient(rest_client.RestClient):
def __init__(self, auth_provider):
super(ZunClient, self).__init__(
auth_provider=auth_provider,
service=CONF.container_management.catalog_type,
service=CONF.container_service.catalog_type,
region=CONF.identity.region,
disable_ssl_certificate_validation=True
)
def get_headers(self):
headers = super(ZunClient, self).get_headers()
if CONTAINER_MANAGEMENT_MICROVERSION:
if CONTAINER_SERVICE_MICROVERSION:
headers[self.api_microversion_header_name] = \
get_container_management_api_version()
get_container_service_api_version()
return headers
def request(self, *args, **kwargs):
resp, resp_body = super(ZunClient, self).request(*args, **kwargs)
if (CONTAINER_MANAGEMENT_MICROVERSION and
CONTAINER_MANAGEMENT_MICROVERSION
if (CONTAINER_SERVICE_MICROVERSION and
CONTAINER_SERVICE_MICROVERSION
!= api_version_utils.LATEST_MICROVERSION):
api_version_utils.assert_version_header_matches_request(
self.api_microversion_header_name,
get_container_management_api_version(),
get_container_service_api_version(),
resp)
return resp, resp_body

View File

@ -32,8 +32,8 @@ class BaseZunTest(api_version_utils.BaseMicroversionTest,
if not CONF.service_available.zun:
skip_msg = 'Zun is disabled'
raise cls.skipException(skip_msg)
cfg_min_version = CONF.container_management.min_microversion
cfg_max_version = CONF.container_management.max_microversion
cfg_min_version = CONF.container_service.min_microversion
cfg_max_version = CONF.container_service.max_microversion
api_version_utils.check_skip_with_microversion(cls.min_microversion,
cls.max_microversion,
cfg_min_version,
@ -49,10 +49,10 @@ class BaseZunTest(api_version_utils.BaseMicroversionTest,
cls.request_microversion = (
api_version_utils.select_request_microversion(
cls.min_microversion,
CONF.container_management.min_microversion
CONF.container_service.min_microversion
))
cls.services_microversion = {
CONF.container_management.catalog_type: cls.request_microversion}
CONF.container_service.catalog_type: cls.request_microversion}
super(BaseZunTest, cls).setup_credentials()
@classmethod
@ -61,8 +61,8 @@ class BaseZunTest(api_version_utils.BaseMicroversionTest,
cls.request_microversion = (
api_version_utils.select_request_microversion(
cls.min_microversion,
CONF.container_management.min_microversion))
cls.wait_timeout = CONF.container_management.wait_timeout
CONF.container_service.min_microversion))
cls.wait_timeout = CONF.container_service.wait_timeout
def setUp(self):
super(BaseZunTest, self).setUp()

View File

@ -20,13 +20,13 @@ service_option = cfg.BoolOpt("zun",
help="Whether or not zun is expected to be "
"available")
container_management_group = cfg.OptGroup(
name="container_management", title="Container Management Service Options")
container_service_group = cfg.OptGroup(
name="container_service", title="Containers Service Options")
ContainerManagementGroup = [
ContainerServiceGroup = [
cfg.StrOpt("catalog_type",
default="container",
help="Catalog type of the container management service."),
help="Catalog type of the containers service."),
cfg.IntOpt("wait_timeout",
default=60,
help="Waiting time for a specific status, in seconds."),

View File

@ -31,13 +31,13 @@ class ZunTempestPlugin(plugins.TempestPlugin):
def register_opts(self, conf):
conf.register_opt(config_zun.service_option,
group='service_available')
conf.register_group(config_zun.container_management_group)
conf.register_opts(config_zun.ContainerManagementGroup,
group='container_management')
conf.register_group(config_zun.container_service_group)
conf.register_opts(config_zun.ContainerServiceGroup,
group='container_service')
conf.register_group(config_zun.docker_group)
conf.register_opts(config_zun.docker_opts, group='docker')
def get_opt_lists(self):
return [(config_zun.container_management_group.name,
config_zun.ContainerManagementGroup),
return [(config_zun.container_service_group.name,
config_zun.ContainerServiceGroup),
('service_available', [config_zun.service_option])]