Add unsupported resources page to documentation

This change adds a new page to the sphinx documentation that lists all
the resources that are not officially supported, such as those marked as
deprecated, unsupported, prototype, etc.

Change-Id: I0a14899f4f9e1539242f898f2d74d2677689d260
changes/73/186573/2
Miguel Grinberg 8 years ago
parent 1724d2fb8e
commit 6311fa3050
  1. 34
      doc/source/ext/resources.py
  2. 1
      doc/source/template_guide/index.rst
  3. 20
      doc/source/template_guide/unsupported.rst

@ -38,6 +38,10 @@ class integratedrespages(nodes.General, nodes.Element):
pass
class unsupportedrespages(nodes.General, nodes.Element):
pass
class contribresourcepages(nodes.General, nodes.Element):
pass
@ -52,11 +56,14 @@ class ResourcePages(compat.Directive):
def path(self):
return None
def statuses(self):
return support.SUPPORT_STATUSES
def run(self):
prefix = self.arguments and self.arguments.pop() or None
content = []
for resource_type, resource_classes in _filter_resources(prefix,
self.path()):
for resource_type, resource_classes in _filter_resources(
prefix, self.path(), self.statuses()):
for resource_class in resource_classes:
self.resource_type = resource_type
self.resource_class = resource_class
@ -337,6 +344,18 @@ class IntegrateResourcePages(ResourcePages):
def path(self):
return 'heat.engine.resources'
def statuses(self):
return [support.SUPPORTED]
class UnsupportedResourcePages(ResourcePages):
def path(self):
return 'heat.engine.resources'
def statuses(self):
return [s for s in support.SUPPORT_STATUSES if s != support.SUPPORTED]
class ContribResourcePages(ResourcePages):
@ -344,18 +363,21 @@ class ContribResourcePages(ResourcePages):
return 'heat.engine.plugins'
def _filter_resources(prefix=None, path=None):
def _filter_resources(prefix=None, path=None, statuses=[]):
def prefix_match(name):
return prefix is None or name.startswith(prefix)
def path_match(cls):
return path is None or cls.__module__.startswith(path)
def status_match(cls):
return cls.support_status.status in statuses
filtered_resources = {}
for name in sorted(six.iterkeys(all_resources)):
if prefix_match(name):
for cls in all_resources.get(name):
if path_match(cls):
if path_match(cls) and status_match(cls):
if filtered_resources.get(name) is not None:
filtered_resources[name].append(cls)
else:
@ -383,6 +405,10 @@ def setup(app):
app.add_directive('integratedrespages', IntegrateResourcePages)
app.add_node(unsupportedrespages)
app.add_directive('unsupportedrespages', UnsupportedResourcePages)
app.add_node(contribresourcepages)
app.add_directive('contribrespages', ContribResourcePages)

@ -23,5 +23,6 @@ Template Guide
composition
openstack
cfn
unsupported
contrib
functions

@ -0,0 +1,20 @@
..
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.
Unsupported Heat Resource Types
===============================
.. rubric:: These resources are enabled, but are not officially supported.
.. unsupportedrespages::
Loading…
Cancel
Save