diff options
author | Simon Pasquier <simon.pasquier@bull.net> | 2014-01-07 13:48:27 +0100 |
---|---|---|
committer | Simon Pasquier <simon.pasquier@bull.net> | 2014-01-13 12:39:00 +0100 |
commit | d19174be975219a0b9ed765df33741befcab50ea (patch) | |
tree | 7d9730e87699d005c5a0d732dc0614231c1fcecf /heatclient/v1/resources.py | |
parent | 2d3ea2e70a54b1dce6106be62a6f9216e974d6f9 (diff) | |
download | python-heatclient-d19174be975219a0b9ed765df33741befcab50ea.tar.gz |
Add to_dict() method to Resource class
Commit a07b8b0b introduces a regression when running 'heat
resource-show' command because heatclient.v1.resources.Resource class
didn't implement the to_dict() method.
This commit adds unit tests for resource show and list commands. It
also removes the use of MagicMock in these tests because it introduced
a recursion issue (see https://review.openstack.org/#/c/65269/).
Change-Id: I6c4c0e293d2955c67a0240136faa2721ef2e4ffa
Closes-Bug: 1266678
Diffstat (limited to 'heatclient/v1/resources.py')
-rw-r--r-- | heatclient/v1/resources.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/heatclient/v1/resources.py b/heatclient/v1/resources.py index 9d66a15..2d22dcf 100644 --- a/heatclient/v1/resources.py +++ b/heatclient/v1/resources.py @@ -13,6 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. +import copy + from heatclient.openstack.common.apiclient import base from heatclient.openstack.common.py3kcompat import urlutils from heatclient.openstack.common import strutils @@ -34,6 +36,9 @@ class Resource(base.Resource): def data(self, **kwargs): return self.manager.data(self, **kwargs) + def to_dict(self): + return copy.deepcopy(self._info) + class ResourceManager(stacks.StackChildManager): resource_class = Resource |