Fix crash when a n hypervisor return no body

This commit is contained in:
Julien Duponchelle committed 2016-03-16 16:10:06 +01:00
1 parent 757ee34dac
commit aa6c44a470
2 files changed
+5 -5

No files matched your search

+1 -1
View File
@@ -148,7 +148,7 @@ class Hypervisor:
raise aiohttp.web.HTTPConflict(text="Conflict {} {}".format(url, body))
else:
raise NotImplemented("{} status code is not supported".format(e.status))
if len(body):
if body and len(body):
try:
response.json = json.loads(body)
except json.JSONDecodeError: