From 8604c64592fb1775e45ad719a2530558e3877483 Mon Sep 17 00:00:00 2001 From: peusterm Date: Tue, 27 Jun 2017 10:50:27 +0200 Subject: [PATCH] Fix: Glance API was not happy with empty body on POST request --- .../api/openstack/openstack_dummies/glance_dummy_api.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/emuvim/api/openstack/openstack_dummies/glance_dummy_api.py b/src/emuvim/api/openstack/openstack_dummies/glance_dummy_api.py index d9ca091..a61c710 100755 --- a/src/emuvim/api/openstack/openstack_dummies/glance_dummy_api.py +++ b/src/emuvim/api/openstack/openstack_dummies/glance_dummy_api.py @@ -134,7 +134,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") -- 2.25.1