Remove SERVICE_NAMES

The rest of services listed in the SERVICE_NAMES got
a class implementation under config_tempest/services
directory in order to remove the hardcoded list of
services - SERVICE_NAMES.

Story: 2002787
Task: 29693

Change-Id: Ibc58236b581551f64dfaf21fb443ed8c1cc1282b
This commit is contained in:
Martin Kopec 2019-03-04 20:52:56 +00:00
parent 33e39f3606
commit e312be824d
12 changed files with 276 additions and 34 deletions

View File

@ -42,19 +42,3 @@ ALL_CREDENTIALS_KEYS = {
"identity.alt_project_name": [],
"identity.admin_domain_name": [],
}
# services, which don't have their own class implemented under
# config_tempest/services, and their codenames
# NOTE: if a service from the dict below gets implementation under
# config_tempest/services it should be removed from the list
SERVICE_NAMES = {
'baremetal': 'ironic',
'database': 'trove',
'data-processing': 'sahara',
'orchestration': 'heat',
'telemetry': 'ceilometer',
'messaging': 'zaqar',
'metric': 'gnocchi',
'event': 'panko',
'workflowv2': 'mistral',
}

View File

@ -0,0 +1,33 @@
# Copyright 2019 Red Hat, Inc.
# 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 config_tempest.services.base import Service
class AlarmingService(Service):
def set_availability(self, conf, available):
# TODO(arxcruz): Remove this once/if we get the following reviews
# merged in all branches supported by tempestconf, or once/if
# tempestconf do not support anymore the OpenStack release where
# those patches are not available.
# https://review.openstack.org/#/c/492526/
# https://review.openstack.org/#/c/492525/
conf.set('service_available', 'aodh', str(available))
conf.set('service_available', 'aodh_plugin', str(available))
@staticmethod
def get_service_name():
return ['aodh']

View File

@ -0,0 +1,27 @@
# Copyright 2019 Red Hat, Inc.
# 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 config_tempest.services.base import Service
class BaremetalService(Service):
@staticmethod
def get_service_name():
return ['ironic']
@staticmethod
def get_codename():
return 'ironic'

View File

@ -0,0 +1,27 @@
# Copyright 2019 Red Hat, Inc.
# 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 config_tempest.services.base import Service
class DataProcessingService(Service):
@staticmethod
def get_service_name():
return ['sahara']
@staticmethod
def get_codename():
return 'sahara'

View File

@ -0,0 +1,27 @@
# Copyright 2019 Red Hat, Inc.
# 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 config_tempest.services.base import Service
class DatabaseService(Service):
@staticmethod
def get_service_name():
return ['trove']
@staticmethod
def get_codename():
return 'trove'

View File

@ -0,0 +1,27 @@
# Copyright 2019 Red Hat, Inc.
# 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 config_tempest.services.base import Service
class EventService(Service):
@staticmethod
def get_service_name():
return ['panko']
@staticmethod
def get_codename():
return 'panko'

View File

@ -0,0 +1,27 @@
# Copyright 2019 Red Hat, Inc.
# 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 config_tempest.services.base import Service
class MessagingService(Service):
@staticmethod
def get_service_name():
return ['zaqar']
@staticmethod
def get_codename():
return 'zaqar'

View File

@ -0,0 +1,27 @@
# Copyright 2019 Red Hat, Inc.
# 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 config_tempest.services.base import Service
class MetricService(Service):
@staticmethod
def get_service_name():
return ['gnocchi']
@staticmethod
def get_codename():
return 'gnocchi'

View File

@ -0,0 +1,27 @@
# Copyright 2019 Red Hat, Inc.
# 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 config_tempest.services.base import Service
class OrchestrationService(Service):
@staticmethod
def get_service_name():
return ['heat']
@staticmethod
def get_codename():
return 'heat'

View File

@ -232,24 +232,6 @@ class Services(object):
horizon.configure_horizon(self._conf)
for service, codename in C.SERVICE_NAMES.items():
# ceilometer is still transitioning from metering to telemetry
if service == 'telemetry' and self.is_service('metering'):
service = 'metering'
available = str(self.is_service(service))
self._conf.set('service_available', codename, available)
# TODO(arxcruz): Remove this once/if we get the following reviews
# merged in all branches supported by tempestconf, or once/if
# tempestconf do not support anymore the OpenStack release where
# those patches are not available.
# https://review.openstack.org/#/c/492526/
# https://review.openstack.org/#/c/492525/
if self.is_service('alarming'):
self._conf.set('service_available', 'aodh', 'True')
self._conf.set('service_available', 'aodh_plugin', 'True')
# TODO(arxcruz): This should be set in compute service, not here,
# however, it requires a refactor in the code, which is not our
# goal right now

View File

@ -0,0 +1,27 @@
# Copyright 2019 Red Hat, Inc.
# 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 config_tempest.services.base import Service
class TelemetryService(Service):
@staticmethod
def get_service_name():
return ['ceilometer']
@staticmethod
def get_codename():
return 'ceilometer'

View File

@ -0,0 +1,27 @@
# Copyright 2019 Red Hat, Inc.
# 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 config_tempest.services.base import Service
class Workflowv2Service(Service):
@staticmethod
def get_service_name():
return ['mistral']
@staticmethod
def get_codename():
return 'mistral'