From bcf607325002f2a2bb2493f32112a4b69974eee0 Mon Sep 17 00:00:00 2001 From: Miguel Grinberg Date: Wed, 27 May 2015 21:13:21 -0700 Subject: [PATCH] Include support status in resource schema This change adds support status information to the resource schema returned by the /resource_types/{resource_name} endpoint. Change-Id: I1d030544630bcaed06aa6fa60ea2554861033384 Closes-Bug: #1459486 --- heat/engine/service.py | 2 ++ heat/rpc/api.py | 3 ++- heat/tests/test_api_openstack_v1.py | 5 +++++ heat/tests/test_engine_service.py | 10 ++++++++++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/heat/engine/service.py b/heat/engine/service.py index a3ac0dce28..1387c75c2f 100644 --- a/heat/engine/service.py +++ b/heat/engine/service.py @@ -1050,6 +1050,8 @@ class EngineService(service.Service): rpc_api.RES_SCHEMA_RES_TYPE: type_name, rpc_api.RES_SCHEMA_PROPERTIES: dict(properties_schema()), rpc_api.RES_SCHEMA_ATTRIBUTES: dict(attributes_schema()), + rpc_api.RES_SCHEMA_SUPPORT_STATUS: + resource_class.support_status.to_dict(), } def generate_template(self, cnxt, type_name, template_type='cfn'): diff --git a/heat/rpc/api.py b/heat/rpc/api.py index a36c6d7411..283fa74e7f 100644 --- a/heat/rpc/api.py +++ b/heat/rpc/api.py @@ -76,8 +76,9 @@ RES_KEYS = ( RES_SCHEMA_KEYS = ( RES_SCHEMA_RES_TYPE, RES_SCHEMA_PROPERTIES, RES_SCHEMA_ATTRIBUTES, + RES_SCHEMA_SUPPORT_STATUS, ) = ( - RES_TYPE, 'properties', 'attributes', + RES_TYPE, 'properties', 'attributes', 'support_status' ) EVENT_KEYS = ( diff --git a/heat/tests/test_api_openstack_v1.py b/heat/tests/test_api_openstack_v1.py index 6742ed8fcf..6278d8fba0 100644 --- a/heat/tests/test_api_openstack_v1.py +++ b/heat/tests/test_api_openstack_v1.py @@ -2036,6 +2036,11 @@ class StackControllerTest(ControllerTest, common.HeatTestCase): 'foo': {'description': 'A generic attribute'}, 'Foo': {'description': 'Another generic attribute'}, }, + 'support_status': { + 'status': 'SUPPORTED', + 'version': None, + 'message': None, + }, } self.m.StubOutWithMock(rpc_client.EngineClient, 'call') rpc_client.EngineClient.call( diff --git a/heat/tests/test_engine_service.py b/heat/tests/test_engine_service.py index 75c41cce85..95084304ab 100644 --- a/heat/tests/test_engine_service.py +++ b/heat/tests/test_engine_service.py @@ -2619,6 +2619,11 @@ class StackServiceTest(common.HeatTestCase): 'foo': {'description': 'A generic attribute'}, 'Foo': {'description': 'Another generic attribute'}, }, + 'support_status': { + 'status': 'SUPPORTED', + 'version': None, + 'message': None, + }, } schema = self.eng.resource_schema(self.ctx, type_name=type_name) @@ -2638,6 +2643,11 @@ class StackServiceTest(common.HeatTestCase): 'attr2': {'description': 'Another generic attribute', 'type': 'map'}, }, + 'support_status': { + 'status': 'SUPPORTED', + 'version': None, + 'message': None, + }, } schema = self.eng.resource_schema(self.ctx, type_name=type_name) self.assertEqual(expected, schema)