Fixed batch errors
This commit is contained in:
parent
f95d72c37c
commit
9af88bf206
2 changed files with 7 additions and 4 deletions
|
|
@ -22,10 +22,13 @@ class BatchResponse(BaseResponse):
|
|||
|
||||
@property
|
||||
def json(self):
|
||||
if self.body is None:
|
||||
if self.body is None or self.body == '':
|
||||
self._json = {}
|
||||
elif not hasattr(self, '_json'):
|
||||
self._json = json.loads(self.body)
|
||||
try:
|
||||
self._json = json.loads(self.body)
|
||||
except json.JSONDecodeError:
|
||||
print()
|
||||
return self._json
|
||||
|
||||
def _get_param(self, param_name, if_none=None):
|
||||
|
|
|
|||
|
|
@ -6,6 +6,6 @@ url_bases = [
|
|||
]
|
||||
|
||||
url_paths = {
|
||||
'{0}/v1/createcomputeenvironment': BatchResponse.dispatch,
|
||||
'{0}/v1/describecomputeenvironments': BatchResponse.dispatch,
|
||||
'{0}/v1/createcomputeenvironment$': BatchResponse.dispatch,
|
||||
'{0}/v1/describecomputeenvironments$': BatchResponse.dispatch,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue