diff options
author | Zuul <zuul@review.opendev.org> | 2020-01-09 16:55:29 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2020-01-09 16:55:29 +0000 |
commit | 4d7af9748e72d10c462bfa86a4437fb0ff260840 (patch) | |
tree | 01a7fe8a6b5367fdd21d75080e25027be085844e | |
parent | 3ab2e2ab89a7ac55786a9776f473689f916b36cb (diff) | |
parent | 6c48f4d03b9506c52bfa8cb0e764b91de7d68f06 (diff) | |
download | heat-4d7af9748e72d10c462bfa86a4437fb0ff260840.tar.gz |
Merge "Update the default implementation of _show_resource"
-rw-r--r-- | doc/source/developing_guides/pluginguide.rst | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/doc/source/developing_guides/pluginguide.rst b/doc/source/developing_guides/pluginguide.rst index 8b3816209..d8d43345a 100644 --- a/doc/source/developing_guides/pluginguide.rst +++ b/doc/source/developing_guides/pluginguide.rst @@ -347,16 +347,19 @@ overridden: """Default implementation; should be overridden by resources. :returns: the map of resource information or None - """ + """ if self.entity: try: obj = getattr(self.client(), self.entity) resource = obj.get(self.resource_id) - return resource.to_dict() - except AttributeError as ex: - LOG.warning(_LW("Resolving 'show' attribute has " - "failed : %s"), ex) - return None + if isinstance(resource, dict): + return resource + else: + return resource.to_dict() + except AttributeError as ex: + LOG.warning("Resolving 'show' attribute has failed : %s", + ex) + return None Property and Attribute Example ****************************** |