Merge "Return template based class in list resource types"
This commit is contained in:
commit
4a8cae5e28
@ -310,15 +310,17 @@ class ResourceRegistry(object):
|
||||
def get_types(self, support_status):
|
||||
'''Return a list of valid resource types.'''
|
||||
|
||||
def is_plugin(key):
|
||||
return isinstance(self._registry[key], ClassResourceInfo)
|
||||
def is_resource(key):
|
||||
return isinstance(self._registry[key], (ClassResourceInfo,
|
||||
TemplateResourceInfo))
|
||||
|
||||
def status_matches(cls):
|
||||
return support_status is None or \
|
||||
cls.value.support_status.status == support_status.encode()
|
||||
return (support_status is None or
|
||||
cls.get_class().support_status.status ==
|
||||
support_status.encode())
|
||||
|
||||
return [name for name, cls in self._registry.iteritems()
|
||||
if is_plugin(name) and status_matches(cls)]
|
||||
if is_resource(name) and status_matches(cls)]
|
||||
|
||||
|
||||
SECTIONS = (PARAMETERS, RESOURCE_REGISTRY) = \
|
||||
|
@ -1791,6 +1791,7 @@ class StackServiceTest(HeatTestCase):
|
||||
resources = self.eng.list_resource_types(self.ctx)
|
||||
self.assertIsInstance(resources, list)
|
||||
self.assertIn('AWS::EC2::Instance', resources)
|
||||
self.assertIn('AWS::RDS::DBInstance', resources)
|
||||
|
||||
def test_list_resource_types_deprecated(self):
|
||||
resources = self.eng.list_resource_types(self.ctx, "DEPRECATED")
|
||||
|
Loading…
Reference in New Issue
Block a user