decode the response as first class python object createAccountResponse is now an instance of createAccountResponse and not just a plain dict.
TODO: 1. nested entities don't work yet. Signed-off-by: Prasanna Santhanam <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/da464aaf Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/da464aaf Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/da464aaf Branch: refs/heads/marvin_refactor Commit: da464aaf90eba20d7081b824b3a2233beeddd75a Parents: 3814eb3 Author: Prasanna Santhanam <[email protected]> Authored: Fri Apr 19 16:52:44 2013 +0530 Committer: Prasanna Santhanam <[email protected]> Committed: Fri Apr 19 16:52:44 2013 +0530 ---------------------------------------------------------------------- tools/marvin/marvin/cloudstackConnection.py | 6 +++--- tools/marvin/marvin/jsonHelper.py | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/da464aaf/tools/marvin/marvin/cloudstackConnection.py ---------------------------------------------------------------------- diff --git a/tools/marvin/marvin/cloudstackConnection.py b/tools/marvin/marvin/cloudstackConnection.py index b1d5a51..f6589bb 100644 --- a/tools/marvin/marvin/cloudstackConnection.py +++ b/tools/marvin/marvin/cloudstackConnection.py @@ -21,9 +21,9 @@ import base64 import hmac import hashlib import time -import marvin.cloudstackException +from marvin import cloudstackException from marvin.cloudstackAPI import * -import marvin.jsonHelper +from marvin import jsonHelper from requests import ConnectionError from requests import HTTPError from requests import Timeout @@ -137,7 +137,7 @@ class CloudConnection(object): else: response = requests.get(self.baseurl, params=payload) except ConnectionError, c: - self.logging.debug("Connection refused. Reason: %s" % + self.logging.debug("Connection refused. Reason: %s %s" % (self.baseurl, c)) raise c except HTTPError, h: http://git-wip-us.apache.org/repos/asf/cloudstack/blob/da464aaf/tools/marvin/marvin/jsonHelper.py ---------------------------------------------------------------------- diff --git a/tools/marvin/marvin/jsonHelper.py b/tools/marvin/marvin/jsonHelper.py index 5b492b1..b0c356f 100644 --- a/tools/marvin/marvin/jsonHelper.py +++ b/tools/marvin/marvin/jsonHelper.py @@ -102,7 +102,8 @@ def finalizeResultObj(result, responseName, responsecls): mirrorObj = False break if mirrorObj: - return value + responsecls.__dict__.update(value.__dict__) + return responsecls else: return result else:
