Skip to content

Commit ed2ce27

Browse files
author
Prasanna Santhanam
committed
CLOUDSTACK-2652: requests module differs on Python 2.6
On 2.6 response.json returns the JSOn in the response while on 2.7 response.json() is a method. Since Marvin installs on both platforms fixing the error appropriately Signed-off-by: Prasanna Santhanam <tsp@apache.org>
1 parent d8f5f2e commit ed2ce27

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

tools/marvin/marvin/cloudstackConnection.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,10 @@ def marvin_request(self, cmd, response_type=None, method='GET'):
219219
cmdname, self.auth, payload=payload, method=method)
220220
self.logging.debug("Request: %s Response: %s" %
221221
(response.url, response.text))
222-
response = jsonHelper.getResultObj(response.json(), response_type)
222+
try:
223+
response = jsonHelper.getResultObj(response.json(), response_type)
224+
except TypeError:
225+
response = jsonHelper.getResultObj(response.json, response_type)
223226

224227
if isAsync == "false":
225228
return response

0 commit comments

Comments
 (0)