Fixed batch errors

This commit is contained in:
Terry Cain 2017-09-29 23:43:03 +01:00
parent f95d72c37c
commit 9af88bf206
No known key found for this signature in database
GPG Key ID: 14D90844E4E9B9F3
2 changed files with 7 additions and 4 deletions

View File

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

View File

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