Fix: Glance API was not happy with empty body on POST request
authorpeusterm <manuel.peuster@uni-paderborn.de>
Tue, 27 Jun 2017 08:50:27 +0000 (10:50 +0200)
committerpeusterm <manuel.peuster@uni-paderborn.de>
Tue, 27 Jun 2017 08:50:27 +0000 (10:50 +0200)
src/emuvim/api/openstack/openstack_dummies/glance_dummy_api.py

index 7819fb9..f02ba12 100755 (executable)
@@ -130,7 +130,10 @@ class GlanceListImagesApi(Resource):
         like the image was just created to make orchestrators, like OSM, happy.
         """
         LOG.debug("API CALL: %s POST" % str(self.__class__.__name__))
-        body_data = json.loads(request.data)
+        try:
+            body_data = json.loads(request.data)
+        except:
+            body_data = dict()
         # lets see what we should create
         img_name = request.headers.get("X-Image-Meta-Name")
         img_size = request.headers.get("X-Image-Meta-Size")