From 7aadc2db7ee6753a5d354ee25ba11e7d9265f8f5 Mon Sep 17 00:00:00 2001 From: lin-hua-cheng Date: Thu, 22 Oct 2015 17:32:45 -0700 Subject: [PATCH] Fix issue when displaying image_member image_member doesn't have a _info attribute, glanceclient returns warlock object instead of a Resource object. Change-Id: If6e7c4bd404454bd6cbe8c111879c1afa1380211 Closes-Bug: #1509054 --- openstackclient/tests/fakes.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/openstackclient/tests/fakes.py b/openstackclient/tests/fakes.py index 357c470..0f5ef74 100644 --- a/openstackclient/tests/fakes.py +++ b/openstackclient/tests/fakes.py @@ -150,3 +150,11 @@ class FakeResponse(requests.Response): self._content = json.dumps(data) if not isinstance(self._content, six.binary_type): self._content = self._content.encode() + + +class FakeModel(dict): + def __getattr__(self, key): + try: + return self[key] + except KeyError: + raise AttributeError(key)