From d8a8f99d39cb225efd3da41915016e97ad9c64e3 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Wed, 2 Mar 2022 19:20:55 +0900 Subject: [PATCH] Remove support for unmaintained Glare Currently tox jobs are broken because python-glareclient can't be installed with the latest constraints. The conflict is caused by: python-cinderclient 8.3.0 depends on PrettyTable>=0.7.2 python-glanceclient 3.6.0 depends on PrettyTable>=0.7.1 python-glareclient 0.5.3 depends on PrettyTable<0.8 and >=0.7.1 ... The user requested (constraint) prettytable===2.5.0 The Glare project has been unmaintained for a while[1]. It does not support any of the current tested runtime and is considered to be incompatible with recent OpenStack releases. Because of these points, this change removes dependency on Glare. Deprecation step is skipped to unblock CI jobs. Also, this change removes the broken lower constraints job. It was removed from Mistral a while ago[2] from the Mistral repo. [1] https://opendev.org/x/glare [2] https://review.opendev.org/c/openstack/mistral/+/770525 Change-Id: Ib6c138e3ce72ce775e29db80a076b9ade37ddaa0 --- .zuul.yaml | 1 - mistral_extra/actions/generator_factory.py | 2 +- mistral_extra/actions/openstack/actions.py | 29 ------------------- mistral_extra/actions/openstack/mapping.json | 19 ------------ .../unit/actions/openstack/test_generator.py | 1 - .../openstack/test_openstack_actions.py | 13 --------- ...remove-glare-support-f31592ead8742ce8.yaml | 6 ++++ requirements.txt | 3 +- tools/get_action_list.py | 11 ------- 9 files changed, 8 insertions(+), 77 deletions(-) create mode 100644 releasenotes/notes/remove-glare-support-f31592ead8742ce8.yaml diff --git a/.zuul.yaml b/.zuul.yaml index 3d4f6fb..6a93e85 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -2,6 +2,5 @@ templates: - openstack-python3-ussuri-jobs - check-requirements - - openstack-lower-constraints-jobs - publish-openstack-docs-pti - release-notes-jobs-python3 diff --git a/mistral_extra/actions/generator_factory.py b/mistral_extra/actions/generator_factory.py index 7b1b401..7845378 100644 --- a/mistral_extra/actions/generator_factory.py +++ b/mistral_extra/actions/generator_factory.py @@ -21,7 +21,7 @@ SUPPORTED_MODULES = [ 'Nova', 'Glance', 'Keystone', 'Heat', 'Neutron', 'Cinder', 'Trove', 'Ironic', 'Baremetal Introspection', 'Swift', 'SwiftService', 'Zaqar', 'Barbican', 'Mistral', 'Designate', 'Magnum', 'Murano', 'Tacker', - 'Aodh', 'Gnocchi', 'Glare', 'Vitrage', 'Senlin', 'Zun', 'Manila' + 'Aodh', 'Gnocchi', 'Vitrage', 'Senlin', 'Zun', 'Manila' ] diff --git a/mistral_extra/actions/openstack/actions.py b/mistral_extra/actions/openstack/actions.py index 8beaf95..d904bef 100644 --- a/mistral_extra/actions/openstack/actions.py +++ b/mistral_extra/actions/openstack/actions.py @@ -54,7 +54,6 @@ cinderclient = _try_import('cinderclient.client') cinder_api_versions = _try_import('cinderclient.api_versions') designateclient = _try_import('designateclient.v2.client') glanceclient = _try_import('glanceclient') -glareclient = _try_import('glareclient.v1.client') gnocchiclient = _try_import('gnocchiclient.v1.client') heatclient = _try_import('heatclient.client') ironic_inspector_client = _try_import('ironic_inspector_client.v1') @@ -914,34 +913,6 @@ class GnocchiAction(base.OpenStackAction): return cls._get_client_class()() -class GlareAction(base.OpenStackAction): - _service_name = 'glare' - - @classmethod - def _get_client_class(cls): - return glareclient.Client - - def _create_client(self, context): - - LOG.debug("Glare action security context: %s", context) - - glare_endpoint = self.get_service_endpoint() - - endpoint_url = keystone_utils.format_url( - glare_endpoint.url, - {'tenant_id': context.project_id} - ) - - return self._get_client_class()( - endpoint_url, - **self.get_session_and_auth(context) - ) - - @classmethod - def _get_fake_client(cls): - return cls._get_client_class()("http://127.0.0.1:9494/") - - class VitrageAction(base.OpenStackAction): _service_type = 'rca' diff --git a/mistral_extra/actions/openstack/mapping.json b/mistral_extra/actions/openstack/mapping.json index 9b22f80..8595791 100644 --- a/mistral_extra/actions/openstack/mapping.json +++ b/mistral_extra/actions/openstack/mapping.json @@ -1230,25 +1230,6 @@ "actions": "actions", "get_action": "get_action" }, - "glare": { - "_comment": "It uses glareclient.v1.", - "artifacts_create": "artifacts.create", - "artifacts_delete": "artifacts.delete", - "artifacts_get": "artifacts.get", - "artifacts_list": "artifacts.list", - "artifacts_update": "artifacts.update", - "artifacts_activate": "artifacts.activate", - "artifacts_deactivate": "artifacts.deactivate", - "artifacts_reactivate": "artifacts.reactivate", - "artifacts_publish": "artifacts.publish", - "artifacts_add_tag": "artifacts.add_tag", - "artifacts_remove_tag": "artifacts.remove_tag", - "artifacts_get_type_list": "artifacts.get_type_list", - "artifacts_get_type_schema": "artifacts.get_type_schema", - "artifacts_upload_blob": "artifacts.upload_blob", - "artifacts_download_blob": "artifacts.download_blob", - "artifacts_add_external_location": "artifacts.add_external_location" - }, "vitrage": { "_comment": "It uses vitrageclient.v1.", "alarm_list": "alarm.list", diff --git a/mistral_extra/tests/unit/actions/openstack/test_generator.py b/mistral_extra/tests/unit/actions/openstack/test_generator.py index b338a2d..275f49d 100644 --- a/mistral_extra/tests/unit/actions/openstack/test_generator.py +++ b/mistral_extra/tests/unit/actions/openstack/test_generator.py @@ -55,7 +55,6 @@ MODULE_MAPPING = { 'senlin': ['senlin.get_profile', actions.SenlinAction], 'aodh': ['aodh.alarm_list', actions.AodhAction], 'gnocchi': ['gnocchi.metric_list', actions.GnocchiAction], - 'glare': ['glare.artifacts_list', actions.GlareAction], 'vitrage': ['vitrage.alarm_get', actions.VitrageAction], 'zun': ['zun.containers_list', actions.ZunAction] } diff --git a/mistral_extra/tests/unit/actions/openstack/test_openstack_actions.py b/mistral_extra/tests/unit/actions/openstack/test_openstack_actions.py index 852df86..414fc0f 100644 --- a/mistral_extra/tests/unit/actions/openstack/test_openstack_actions.py +++ b/mistral_extra/tests/unit/actions/openstack/test_openstack_actions.py @@ -338,19 +338,6 @@ class OpenStackActionTest(base.BaseTestCase): self.assertTrue(mocked().metric.get.called) mocked().metric.get.assert_called_once_with(metric_id="1234-abcd") - @mock.patch.object(actions.GlareAction, '_get_client') - def test_glare_action(self, mocked): - mock_ctx = mock.Mock() - method_name = "artifacts.get" - action_class = actions.GlareAction - action_class.client_method_name = method_name - params = {'artifact_id': '1234-abcd'} - action = action_class(**params) - action.run(mock_ctx) - - self.assertTrue(mocked().artifacts.get.called) - mocked().artifacts.get.assert_called_once_with(artifact_id="1234-abcd") - @mock.patch.object(actions.VitrageAction, '_get_client') def test_vitrage_action(self, mocked): mock_ctx = mock.Mock() diff --git a/releasenotes/notes/remove-glare-support-f31592ead8742ce8.yaml b/releasenotes/notes/remove-glare-support-f31592ead8742ce8.yaml new file mode 100644 index 0000000..d581f17 --- /dev/null +++ b/releasenotes/notes/remove-glare-support-f31592ead8742ce8.yaml @@ -0,0 +1,6 @@ +--- +upgrade: + - | + The ``Glare`` project is no longer maintained and is not compatible with + the global runtime requirement. Because of this, support for Glare + resources have been removed. diff --git a/requirements.txt b/requirements.txt index e4667cd..dfca098 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,7 +13,6 @@ python-cinderclient!=4.0.0,>=3.3.0 # Apache-2.0 python-zaqarclient>=1.0.0 # Apache-2.0 python-designateclient>=2.7.0 # Apache-2.0 python-glanceclient>=2.8.0 # Apache-2.0 -python-glareclient>=0.3.0 # Apache-2.0 python-heatclient>=1.10.0 # Apache-2.0 python-keystoneclient>=3.8.0 # Apache-2.0 python-mistralclient!=3.2.0,>=3.1.0 # Apache-2.0 @@ -32,4 +31,4 @@ python-vitrageclient>=2.0.0 # Apache-2.0 python-zunclient>=3.4.0 # Apache-2.0 oauthlib>=0.6.2 # BSD yaql>=1.1.3 # Apache-2.0 -keystoneauth1>=3.18.0 # Apache-2.0 \ No newline at end of file +keystoneauth1>=3.18.0 # Apache-2.0 diff --git a/tools/get_action_list.py b/tools/get_action_list.py index 28e6682..4e7cd1b 100644 --- a/tools/get_action_list.py +++ b/tools/get_action_list.py @@ -38,7 +38,6 @@ from cinderclient.apiclient import base as cinder_base from cinderclient.v3 import client as cinderclient from designateclient import client as designateclient from glanceclient.v2 import client as glanceclient -from glareclient.v1 import client as glareclient from gnocchiclient.v1 import base as gnocchi_base from gnocchiclient.v1 import client as gnocchiclient from heatclient.common import base as heat_base @@ -160,9 +159,6 @@ DESIGNATE_NAMESPACE_LIST = [ ] -GLARE_NAMESPACE_LIST = ['artifacts', 'versions'] - - def get_nova_client(**kwargs): return novaclient.Client(2) @@ -222,10 +218,6 @@ def get_gnocchi_client(**kwargs): return gnocchiclient.Client() -def get_glare_client(**kwargs): - return glareclient.Client('') - - def get_manila_client(**kwargs): return manilaclient.Client( input_auth_token='token', @@ -248,7 +240,6 @@ CLIENTS = { 'murano': get_murano_client, 'aodh': get_aodh_client, 'gnocchi': get_gnocchi_client, - 'glare': get_glare_client, 'manila': get_manila_client, # 'neutron': get_nova_client # 'baremetal_introspection': ... @@ -270,7 +261,6 @@ BASE_MANAGERS = { 'murano': BASE_MURANO_MANAGER, 'aodh': BASE_AODH_MANAGER, 'gnocchi': BASE_GNOCCHI_MANAGER, - 'glare': None, 'manila': BASE_MANILA_MANAGER, # 'neutron': BASE_NOVA_MANAGER # 'baremetal_introspection': ... @@ -280,7 +270,6 @@ BASE_MANAGERS = { NAMESPACES = { 'glance': GLANCE_NAMESPACE_LIST, 'designate': DESIGNATE_NAMESPACE_LIST, - 'glare': GLARE_NAMESPACE_LIST } ALLOWED_ATTRS = ['service_catalog', 'catalog'] FORBIDDEN_METHODS = [