From b862772e46666389e12e1ea6d53815311a4a4dbb Mon Sep 17 00:00:00 2001 From: Prasanna Santhanam Date: Fri, 19 Apr 2013 16:52:44 +0530 Subject: [PATCH] marvin_refactor: 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 --- tools/marvin/marvin/cloudstackConnection.py | 4 ++-- tools/marvin/marvin/jsonHelper.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/marvin/marvin/cloudstackConnection.py b/tools/marvin/marvin/cloudstackConnection.py index 50131eb2c3f..0337b8658c4 100644 --- a/tools/marvin/marvin/cloudstackConnection.py +++ b/tools/marvin/marvin/cloudstackConnection.py @@ -22,9 +22,9 @@ import hmac import hashlib import logging 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 diff --git a/tools/marvin/marvin/jsonHelper.py b/tools/marvin/marvin/jsonHelper.py index a075095f06b..6c56ef9b608 100644 --- a/tools/marvin/marvin/jsonHelper.py +++ b/tools/marvin/marvin/jsonHelper.py @@ -123,7 +123,8 @@ def finalizeResultObj(result, responseName, responsecls): mirrorObj = False break if mirrorObj: - return value + responsecls.__dict__.update(value.__dict__) + return responsecls else: return result else: