From dfaca88c8fd1004a407ad645dc0b67df1a03a2a1 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 7819fb9..f02ba12 100755 --- a/src/emuvim/api/openstack/openstack_dummies/glance_dummy_api.py +++ b/src/emuvim/api/openstack/openstack_dummies/glance_dummy_api.py @@ -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") -- 2.25.1