From e312be824da11c6ab04bbccc7d566aeff3ef1941 Mon Sep 17 00:00:00 2001 From: Martin Kopec Date: Mon, 4 Mar 2019 20:52:56 +0000 Subject: [PATCH] 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 --- config_tempest/constants.py | 16 ----------- config_tempest/services/alarming.py | 33 ++++++++++++++++++++++ config_tempest/services/baremetal.py | 27 ++++++++++++++++++ config_tempest/services/data-processing.py | 27 ++++++++++++++++++ config_tempest/services/database.py | 27 ++++++++++++++++++ config_tempest/services/event.py | 27 ++++++++++++++++++ config_tempest/services/messaging.py | 27 ++++++++++++++++++ config_tempest/services/metric.py | 27 ++++++++++++++++++ config_tempest/services/orchestration.py | 27 ++++++++++++++++++ config_tempest/services/services.py | 18 ------------ config_tempest/services/telemetry.py | 27 ++++++++++++++++++ config_tempest/services/workflowv2.py | 27 ++++++++++++++++++ 12 files changed, 276 insertions(+), 34 deletions(-) create mode 100644 config_tempest/services/alarming.py create mode 100644 config_tempest/services/baremetal.py create mode 100644 config_tempest/services/data-processing.py create mode 100644 config_tempest/services/database.py create mode 100644 config_tempest/services/event.py create mode 100644 config_tempest/services/messaging.py create mode 100644 config_tempest/services/metric.py create mode 100644 config_tempest/services/orchestration.py create mode 100644 config_tempest/services/telemetry.py create mode 100644 config_tempest/services/workflowv2.py diff --git a/config_tempest/constants.py b/config_tempest/constants.py index c752f044..5580edbd 100644 --- a/config_tempest/constants.py +++ b/config_tempest/constants.py @@ -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', -} diff --git a/config_tempest/services/alarming.py b/config_tempest/services/alarming.py new file mode 100644 index 00000000..a7e51ee8 --- /dev/null +++ b/config_tempest/services/alarming.py @@ -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'] diff --git a/config_tempest/services/baremetal.py b/config_tempest/services/baremetal.py new file mode 100644 index 00000000..2d9a4810 --- /dev/null +++ b/config_tempest/services/baremetal.py @@ -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' diff --git a/config_tempest/services/data-processing.py b/config_tempest/services/data-processing.py new file mode 100644 index 00000000..d1f5f2ff --- /dev/null +++ b/config_tempest/services/data-processing.py @@ -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' diff --git a/config_tempest/services/database.py b/config_tempest/services/database.py new file mode 100644 index 00000000..f5a8a11a --- /dev/null +++ b/config_tempest/services/database.py @@ -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' diff --git a/config_tempest/services/event.py b/config_tempest/services/event.py new file mode 100644 index 00000000..dddc3168 --- /dev/null +++ b/config_tempest/services/event.py @@ -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' diff --git a/config_tempest/services/messaging.py b/config_tempest/services/messaging.py new file mode 100644 index 00000000..5395fa5b --- /dev/null +++ b/config_tempest/services/messaging.py @@ -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' diff --git a/config_tempest/services/metric.py b/config_tempest/services/metric.py new file mode 100644 index 00000000..60cc4e15 --- /dev/null +++ b/config_tempest/services/metric.py @@ -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' diff --git a/config_tempest/services/orchestration.py b/config_tempest/services/orchestration.py new file mode 100644 index 00000000..4b5953ac --- /dev/null +++ b/config_tempest/services/orchestration.py @@ -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' diff --git a/config_tempest/services/services.py b/config_tempest/services/services.py index 2eddfcca..7a4657b7 100644 --- a/config_tempest/services/services.py +++ b/config_tempest/services/services.py @@ -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 diff --git a/config_tempest/services/telemetry.py b/config_tempest/services/telemetry.py new file mode 100644 index 00000000..659fb03f --- /dev/null +++ b/config_tempest/services/telemetry.py @@ -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' diff --git a/config_tempest/services/workflowv2.py b/config_tempest/services/workflowv2.py new file mode 100644 index 00000000..e2ccfac6 --- /dev/null +++ b/config_tempest/services/workflowv2.py @@ -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'