X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2Fvim-emu.git;a=blobdiff_plain;f=src%2Femuvim%2Fapi%2Fopenstack%2Fopenstack_dummies%2Fheat_dummy_api.py;fp=src%2Femuvim%2Fapi%2Fopenstack%2Fopenstack_dummies%2Fheat_dummy_api.py;h=9cd4d5d81118ac86f5857acffd4d8b098056eb01;hp=86fb6c164689d5dd3a5f530fc9aa831356c374cc;hb=aa8823c85d94a4fa72de058076195296334cdb91;hpb=85408ed517f100c3e477efd35e54630bf9171af0 diff --git a/src/emuvim/api/openstack/openstack_dummies/heat_dummy_api.py b/src/emuvim/api/openstack/openstack_dummies/heat_dummy_api.py index 86fb6c1..9cd4d5d 100755 --- a/src/emuvim/api/openstack/openstack_dummies/heat_dummy_api.py +++ b/src/emuvim/api/openstack/openstack_dummies/heat_dummy_api.py @@ -116,7 +116,7 @@ class HeatCreateStack(Resource): reader = HeatParser(self.api.compute) if isinstance(stack_dict['template'], str) or isinstance( - stack_dict['template'], unicode): + stack_dict['template'], bytes): stack_dict['template'] = json.loads(stack_dict['template']) if not reader.parse_input( stack_dict['template'], stack, self.api.compute.dc.label): @@ -142,7 +142,7 @@ class HeatCreateStack(Resource): except Exception as ex: LOG.exception("Heat: Create Stack exception.") - return ex.message, 500 + return str(ex), 500 def get(self, tenant_id): """ @@ -174,7 +174,7 @@ class HeatCreateStack(Resource): status=200, mimetype="application/json") except Exception as ex: LOG.exception("Heat: List Stack exception.") - return ex.message, 500 + return str(ex), 500 class HeatShowStack(Resource): @@ -244,7 +244,7 @@ class HeatShowStack(Resource): except Exception as ex: LOG.exception("Heat: Show stack exception.") - return ex.message, 500 + return str(ex), 500 class HeatShowStackTemplate(Resource): @@ -278,7 +278,7 @@ class HeatShowStackTemplate(Resource): except Exception as ex: LOG.exception("Heat: Show stack template exception.") - return ex.message, 500 + return str(ex), 500 class HeatShowStackResources(Resource): @@ -313,7 +313,7 @@ class HeatShowStackResources(Resource): except Exception as ex: LOG.exception("Heat: Show stack template exception.") - return ex.message, 500 + return str(ex), 500 class HeatUpdateStack(Resource): @@ -362,7 +362,7 @@ class HeatUpdateStack(Resource): reader = HeatParser(self.api.compute) if isinstance(stack_dict['template'], str) or isinstance( - stack_dict['template'], unicode): + stack_dict['template'], bytes): stack_dict['template'] = json.loads(stack_dict['template']) if not reader.parse_input( stack_dict['template'], stack, self.api.compute.dc.label, stack_update=True): @@ -376,7 +376,7 @@ class HeatUpdateStack(Resource): except Exception as ex: LOG.exception("Heat: Update Stack exception") - return ex.message, 500 + return str(ex), 500 class HeatDeleteStack(Resource): @@ -408,4 +408,4 @@ class HeatDeleteStack(Resource): except Exception as ex: LOG.exception("Heat: Delete Stack exception") - return ex.message, 500 + return str(ex), 500