From: peusterm Date: Tue, 27 Jun 2017 08:50:27 +0000 (+0200) Subject: Fix: Glance API was not happy with empty body on POST request X-Git-Tag: v3.1~17^2~6^2~4 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=dfaca88c8fd1004a407ad645dc0b67df1a03a2a1;p=osm%2Fvim-emu.git Fix: Glance API was not happy with empty body on POST request --- 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")