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 <tsp@apache.org>
This commit is contained in:
Prasanna Santhanam 2013-04-19 16:52:44 +05:30
parent c6f0876fe9
commit b862772e46
2 changed files with 4 additions and 3 deletions

View File

@ -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

View File

@ -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: