From 1bcddc5f18743507fee4c2bbe127c9bce46beed8 Mon Sep 17 00:00:00 2001 From: micafer Date: Fri, 7 Jun 2019 11:44:12 +0200 Subject: [PATCH 1/5] Add test #853 --- test/unit/test_im_logic.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/unit/test_im_logic.py b/test/unit/test_im_logic.py index 4a99f4e93..b46566cd9 100755 --- a/test/unit/test_im_logic.py +++ b/test/unit/test_im_logic.py @@ -769,6 +769,11 @@ def test_get_inf_state(self, get_inf_ids): state = IM.GetInfrastructureState("1", auth0) self.assertEqual(state["state"], "running") + inf.get_vm_list.return_value = [] + inf.configured = None + state = IM.GetInfrastructureState("1", auth0) + self.assertEqual(state["state"], "pending") + def test_altervm(self): """Test AlterVM""" radl = RADL() From c335f853662ef1bf8369e9226c0434cbcfba7153 Mon Sep 17 00:00:00 2001 From: micafer Date: Tue, 11 Jun 2019 16:14:36 +0200 Subject: [PATCH 2/5] Improve code --- doc/source/REST.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/source/REST.rst b/doc/source/REST.rst index d13cdf2e6..7fc258a51 100644 --- a/doc/source/REST.rst +++ b/doc/source/REST.rst @@ -21,11 +21,12 @@ Next tables summaries the resources and the HTTP methods available. | **GET** | | **List** the infrastructure IDs. | | **List** the virtual machines | | **Get** information associated to the | | | | | in the infrastructure ``infId`` | | virtual machine ``vmId`` in ``infId``. | +-------------+------------------------------------+------------------------------------+-------------------------------------------+ -| **POST** | | **Create** a new infrastructure | | **Create** a new virtual machine | | **Alter** VM properties based on | -| | | based on the RADL posted | | based on the RADL posted. | | then RADL posted | +| **POST** | | **Create** a new infrastructure | | **Add or Remove** virtual | | **Alter** VM properties based on | +| | | based on the RADL or TOSCA | | machines based on the RADL | | then RADL posted. | +| | | posted. | | or TOSCA posted. | | +-------------+------------------------------------+------------------------------------+-------------------------------------------+ | **PUT** | | **Import** an infrastructure | | | **Modify** the virtual machine based on | -| | | from another IM instance | | | the RADL posted. | +| | | from another IM instance | | | the RADL or TOSCA posted. | +-------------+------------------------------------+------------------------------------+-------------------------------------------+ | **DELETE** | | | **Undeploy** all the virtual | | **Undeploy** the virtual machine. | | | | | machines in the infrastructure. | | From 7d64f97cf44e63335cc3862688e18e65f602e13a Mon Sep 17 00:00:00 2001 From: micafer Date: Wed, 12 Jun 2019 11:54:52 +0200 Subject: [PATCH 3/5] Fix #856 --- IM/REST.py | 173 ++++++++++++++++++++++-------------------- IM/ServiceRequests.py | 2 +- 2 files changed, 91 insertions(+), 84 deletions(-) diff --git a/IM/REST.py b/IM/REST.py index cb0fdcf7f..1c5262c20 100644 --- a/IM/REST.py +++ b/IM/REST.py @@ -304,6 +304,13 @@ def format_output(res, default_type="text/plain", field_name=None, list_field_na return info +def get_ex_error(ex): + """ + Return a secure string with the error of the exception in Py2 and Py3 + """ + return getattr(ex, 'message', get_ex_error(ex) if len(ex.args) else repr(ex)) + + @app.route('/infrastructures/:infid', method='DELETE') def RESTDestroyInfrastructure(infid=None): try: @@ -316,14 +323,14 @@ def RESTDestroyInfrastructure(infid=None): bottle.response.content_type = "text/plain" return "" except DeletedInfrastructureException as ex: - return return_error(404, "Error Destroying Inf: %s" % ex.args[0]) + return return_error(404, "Error Destroying Inf: %s" % get_ex_error(ex)) except IncorrectInfrastructureException as ex: - return return_error(404, "Error Destroying Inf: %s" % ex.args[0]) + return return_error(404, "Error Destroying Inf: %s" % get_ex_error(ex)) except UnauthorizedUserException as ex: - return return_error(403, "Error Destroying Inf: %s" % ex.args[0]) + return return_error(403, "Error Destroying Inf: %s" % get_ex_error(ex)) except Exception as ex: logger.exception("Error Destroying Inf") - return return_error(400, "Error Destroying Inf: %s" % ex.args[0]) + return return_error(400, "Error Destroying Inf: %s" % get_ex_error(ex)) @app.route('/infrastructures/:infid', method='GET') @@ -342,14 +349,14 @@ def RESTGetInfrastructureInfo(infid=None): return format_output(res, "text/uri-list", "uri-list", "uri") except DeletedInfrastructureException as ex: - return return_error(404, "Error Getting Inf. info: %s" % ex.args[0]) + return return_error(404, "Error Getting Inf. info: %s" % get_ex_error(ex)) except IncorrectInfrastructureException as ex: - return return_error(404, "Error Getting Inf. info: %s" % ex.args[0]) + return return_error(404, "Error Getting Inf. info: %s" % get_ex_error(ex)) except UnauthorizedUserException as ex: - return return_error(403, "Error Getting Inf. info: %s" % ex.args[0]) + return return_error(403, "Error Getting Inf. info: %s" % get_ex_error(ex)) except Exception as ex: logger.exception("Error Getting Inf. info") - return return_error(400, "Error Getting Inf. info: %s" % ex.args[0]) + return return_error(400, "Error Getting Inf. info: %s" % get_ex_error(ex)) @app.route('/infrastructures/:infid/:prop', method='GET') @@ -428,14 +435,14 @@ def RESTGetInfrastructureProperty(infid=None, prop=None): return format_output(res, field_name=prop) except DeletedInfrastructureException as ex: - return return_error(404, "Error Getting Inf. prop: %s" % ex.args[0]) + return return_error(404, "Error Getting Inf. prop: %s" % get_ex_error(ex)) except IncorrectInfrastructureException as ex: - return return_error(404, "Error Getting Inf. prop: %s" % ex.args[0]) + return return_error(404, "Error Getting Inf. prop: %s" % get_ex_error(ex)) except UnauthorizedUserException as ex: - return return_error(403, "Error Getting Inf. prop: %s" % ex.args[0]) + return return_error(403, "Error Getting Inf. prop: %s" % get_ex_error(ex)) except Exception as ex: logger.exception("Error Getting Inf. prop") - return return_error(400, "Error Getting Inf. prop: %s" % ex.args[0]) + return return_error(400, "Error Getting Inf. prop: %s" % get_ex_error(ex)) @app.route('/infrastructures', method='GET') @@ -454,10 +461,10 @@ def RESTGetInfrastructureList(): return format_output(res, "text/uri-list", "uri-list", "uri") except InvaliddUserException as ex: - return return_error(401, "Error Getting Inf. List: %s" % ex.args[0]) + return return_error(401, "Error Getting Inf. List: %s" % get_ex_error(ex)) except Exception as ex: logger.exception("Error Getting Inf. List") - return return_error(400, "Error Getting Inf. List: %s" % ex.args[0]) + return return_error(400, "Error Getting Inf. List: %s" % get_ex_error(ex)) @app.route('/infrastructures', method='POST') @@ -506,10 +513,10 @@ def RESTCreateInfrastructure(): return format_output(res, "text/uri-list", "uri") except InvaliddUserException as ex: - return return_error(401, "Error Getting Inf. info: %s" % ex.args[0]) + return return_error(401, "Error Getting Inf. info: %s" % get_ex_error(ex)) except Exception as ex: logger.exception("Error Creating Inf.") - return return_error(400, "Error Creating Inf.: %s" % ex.args[0]) + return return_error(400, "Error Creating Inf.: %s" % get_ex_error(ex)) @app.route('/infrastructures', method='PUT') @@ -534,10 +541,10 @@ def RESTImportInfrastructure(): return format_output(res, "text/uri-list", "uri") except InvaliddUserException as ex: - return return_error(401, "Error Impporting Inf.: %s" % ex.args[0]) + return return_error(401, "Error Impporting Inf.: %s" % get_ex_error(ex)) except Exception as ex: logger.exception("Error Impporting Inf.") - return return_error(400, "Error Impporting Inf.: %s" % ex.args[0]) + return return_error(400, "Error Impporting Inf.: %s" % get_ex_error(ex)) @app.route('/infrastructures/:infid/vms/:vmid', method='GET') @@ -551,18 +558,18 @@ def RESTGetVMInfo(infid=None, vmid=None): radl = InfrastructureManager.GetVMInfo(infid, vmid, auth) return format_output(radl, field_name="radl") except DeletedInfrastructureException as ex: - return return_error(404, "Error Getting VM. info: %s" % ex.args[0]) + return return_error(404, "Error Getting VM. info: %s" % get_ex_error(ex)) except IncorrectInfrastructureException as ex: - return return_error(404, "Error Getting VM. info: %s" % ex.args[0]) + return return_error(404, "Error Getting VM. info: %s" % get_ex_error(ex)) except UnauthorizedUserException as ex: - return return_error(403, "Error Getting VM. info: %s" % ex.args[0]) + return return_error(403, "Error Getting VM. info: %s" % get_ex_error(ex)) except DeletedVMException as ex: - return return_error(404, "Error Getting VM. info: %s" % ex.args[0]) + return return_error(404, "Error Getting VM. info: %s" % get_ex_error(ex)) except IncorrectVMException as ex: - return return_error(404, "Error Getting VM. info: %s" % ex.args[0]) + return return_error(404, "Error Getting VM. info: %s" % get_ex_error(ex)) except Exception as ex: logger.exception("Error Getting VM info") - return return_error(400, "Error Getting VM info: %s" % ex.args[0]) + return return_error(400, "Error Getting VM info: %s" % get_ex_error(ex)) @app.route('/infrastructures/:infid/vms/:vmid/:prop', method='GET') @@ -646,18 +653,18 @@ def RESTGetVMProperty(infid=None, vmid=None, prop=None): else: return format_output(info, field_name=prop) except DeletedInfrastructureException as ex: - return return_error(404, "Error Getting VM. property: %s" % ex.args[0]) + return return_error(404, "Error Getting VM. property: %s" % get_ex_error(ex)) except IncorrectInfrastructureException as ex: - return return_error(404, "Error Getting VM. property: %s" % ex.args[0]) + return return_error(404, "Error Getting VM. property: %s" % get_ex_error(ex)) except UnauthorizedUserException as ex: - return return_error(403, "Error Getting VM. property: %s" % ex.args[0]) + return return_error(403, "Error Getting VM. property: %s" % get_ex_error(ex)) except DeletedVMException as ex: - return return_error(404, "Error Getting VM. property: %s" % ex.args[0]) + return return_error(404, "Error Getting VM. property: %s" % get_ex_error(ex)) except IncorrectVMException as ex: - return return_error(404, "Error Getting VM. property: %s" % ex.args[0]) + return return_error(404, "Error Getting VM. property: %s" % get_ex_error(ex)) except Exception as ex: logger.exception("Error Getting VM property") - return return_error(400, "Error Getting VM property: %s" % ex.args[0]) + return return_error(400, "Error Getting VM property: %s" % get_ex_error(ex)) @app.route('/infrastructures/:infid', method='POST') @@ -715,14 +722,14 @@ def RESTAddResource(infid=None): return format_output(res, "text/uri-list", "uri-list", "uri") except DeletedInfrastructureException as ex: - return return_error(404, "Error Adding resources: %s" % ex.args[0]) + return return_error(404, "Error Adding resources: %s" % get_ex_error(ex)) except IncorrectInfrastructureException as ex: - return return_error(404, "Error Adding resources: %s" % ex.args[0]) + return return_error(404, "Error Adding resources: %s" % get_ex_error(ex)) except UnauthorizedUserException as ex: - return return_error(403, "Error Adding resources: %s" % ex.args[0]) + return return_error(403, "Error Adding resources: %s" % get_ex_error(ex)) except Exception as ex: logger.exception("Error Adding resources") - return return_error(400, "Error Adding resources: %s" % ex.args[0]) + return return_error(400, "Error Adding resources: %s" % get_ex_error(ex)) @app.route('/infrastructures/:infid/vms/:vmid', method='DELETE') @@ -747,18 +754,18 @@ def RESTRemoveResource(infid=None, vmid=None): bottle.response.content_type = "text/plain" return "" except DeletedInfrastructureException as ex: - return return_error(404, "Error Removing resources: %s" % ex.args[0]) + return return_error(404, "Error Removing resources: %s" % get_ex_error(ex)) except IncorrectInfrastructureException as ex: - return return_error(404, "Error Removing resources: %s" % ex.args[0]) + return return_error(404, "Error Removing resources: %s" % get_ex_error(ex)) except UnauthorizedUserException as ex: - return return_error(403, "Error Removing resources: %s" % ex.args[0]) + return return_error(403, "Error Removing resources: %s" % get_ex_error(ex)) except DeletedVMException as ex: - return return_error(404, "Error Removing resources: %s" % ex.args[0]) + return return_error(404, "Error Removing resources: %s" % get_ex_error(ex)) except IncorrectVMException as ex: - return return_error(404, "Error Removing resources: %s" % ex.args[0]) + return return_error(404, "Error Removing resources: %s" % get_ex_error(ex)) except Exception as ex: logger.exception("Error Removing resources") - return return_error(400, "Error Removing resources: %s" % ex.args[0]) + return return_error(400, "Error Removing resources: %s" % get_ex_error(ex)) @app.route('/infrastructures/:infid/vms/:vmid', method='PUT') @@ -787,18 +794,18 @@ def RESTAlterVM(infid=None, vmid=None): return format_output(vm_info, field_name="radl") except DeletedInfrastructureException as ex: - return return_error(404, "Error modifying resources: %s" % ex.args[0]) + return return_error(404, "Error modifying resources: %s" % get_ex_error(ex)) except IncorrectInfrastructureException as ex: - return return_error(404, "Error modifying resources: %s" % ex.args[0]) + return return_error(404, "Error modifying resources: %s" % get_ex_error(ex)) except UnauthorizedUserException as ex: - return return_error(403, "Error modifying resources: %s" % ex.args[0]) + return return_error(403, "Error modifying resources: %s" % get_ex_error(ex)) except DeletedVMException as ex: - return return_error(404, "Error modifying resources: %s" % ex.args[0]) + return return_error(404, "Error modifying resources: %s" % get_ex_error(ex)) except IncorrectVMException as ex: - return return_error(404, "Error modifying resources: %s" % ex.args[0]) + return return_error(404, "Error modifying resources: %s" % get_ex_error(ex)) except Exception as ex: logger.exception("Error modifying resources") - return return_error(400, "Error modifying resources: %s" % ex.args[0]) + return return_error(400, "Error modifying resources: %s" % get_ex_error(ex)) @app.route('/infrastructures/:infid/reconfigure', method='PUT') @@ -833,14 +840,14 @@ def RESTReconfigureInfrastructure(infid=None): bottle.response.content_type = "text/plain" return InfrastructureManager.Reconfigure(infid, radl_data, auth, vm_list) except DeletedInfrastructureException as ex: - return return_error(404, "Error reconfiguring infrastructure: %s" % ex.args[0]) + return return_error(404, "Error reconfiguring infrastructure: %s" % get_ex_error(ex)) except IncorrectInfrastructureException as ex: - return return_error(404, "Error reconfiguring infrastructure: %s" % ex.args[0]) + return return_error(404, "Error reconfiguring infrastructure: %s" % get_ex_error(ex)) except UnauthorizedUserException as ex: - return return_error(403, "Error reconfiguring infrastructure: %s" % ex.args[0]) + return return_error(403, "Error reconfiguring infrastructure: %s" % get_ex_error(ex)) except Exception as ex: logger.exception("Error reconfiguring infrastructure") - return return_error(400, "Error reconfiguring infrastructure: %s" % ex.args[0]) + return return_error(400, "Error reconfiguring infrastructure: %s" % get_ex_error(ex)) @app.route('/infrastructures/:infid/start', method='PUT') @@ -854,14 +861,14 @@ def RESTStartInfrastructure(infid=None): bottle.response.content_type = "text/plain" return InfrastructureManager.StartInfrastructure(infid, auth) except DeletedInfrastructureException as ex: - return return_error(404, "Error starting infrastructure: %s" % ex.args[0]) + return return_error(404, "Error starting infrastructure: %s" % get_ex_error(ex)) except IncorrectInfrastructureException as ex: - return return_error(404, "Error starting infrastructure: %s" % ex.args[0]) + return return_error(404, "Error starting infrastructure: %s" % get_ex_error(ex)) except UnauthorizedUserException as ex: - return return_error(403, "Error starting infrastructure: %s" % ex.args[0]) + return return_error(403, "Error starting infrastructure: %s" % get_ex_error(ex)) except Exception as ex: logger.exception("Error starting infrastructure") - return return_error(400, "Error starting infrastructure: %s" % ex.args[0]) + return return_error(400, "Error starting infrastructure: %s" % get_ex_error(ex)) @app.route('/infrastructures/:infid/stop', method='PUT') @@ -875,14 +882,14 @@ def RESTStopInfrastructure(infid=None): bottle.response.content_type = "text/plain" return InfrastructureManager.StopInfrastructure(infid, auth) except DeletedInfrastructureException as ex: - return return_error(404, "Error stopping infrastructure: %s" % ex.args[0]) + return return_error(404, "Error stopping infrastructure: %s" % get_ex_error(ex)) except IncorrectInfrastructureException as ex: - return return_error(404, "Error stopping infrastructure: %s" % ex.args[0]) + return return_error(404, "Error stopping infrastructure: %s" % get_ex_error(ex)) except UnauthorizedUserException as ex: - return return_error(403, "Error stopping infrastructure: %s" % ex.args[0]) + return return_error(403, "Error stopping infrastructure: %s" % get_ex_error(ex)) except Exception as ex: logger.exception("Error stopping infrastructure") - return return_error(400, "Error stopping infrastructure: %s" % ex.args[0]) + return return_error(400, "Error stopping infrastructure: %s" % get_ex_error(ex)) @app.route('/infrastructures/:infid/vms/:vmid/start', method='PUT') @@ -896,18 +903,18 @@ def RESTStartVM(infid=None, vmid=None): bottle.response.content_type = "text/plain" return InfrastructureManager.StartVM(infid, vmid, auth) except DeletedInfrastructureException as ex: - return return_error(404, "Error starting VM: %s" % ex.args[0]) + return return_error(404, "Error starting VM: %s" % get_ex_error(ex)) except IncorrectInfrastructureException as ex: - return return_error(404, "Error starting VM: %s" % ex.args[0]) + return return_error(404, "Error starting VM: %s" % get_ex_error(ex)) except UnauthorizedUserException as ex: - return return_error(403, "Error starting VM: %s" % ex.args[0]) + return return_error(403, "Error starting VM: %s" % get_ex_error(ex)) except DeletedVMException as ex: - return return_error(404, "Error starting VM: %s" % ex.args[0]) + return return_error(404, "Error starting VM: %s" % get_ex_error(ex)) except IncorrectVMException as ex: - return return_error(404, "Error starting VM: %s" % ex.args[0]) + return return_error(404, "Error starting VM: %s" % get_ex_error(ex)) except Exception as ex: logger.exception("Error starting VM") - return return_error(400, "Error starting VM: %s" % ex.args[0]) + return return_error(400, "Error starting VM: %s" % get_ex_error(ex)) @app.route('/infrastructures/:infid/vms/:vmid/stop', method='PUT') @@ -921,18 +928,18 @@ def RESTStopVM(infid=None, vmid=None): bottle.response.content_type = "text/plain" return InfrastructureManager.StopVM(infid, vmid, auth) except DeletedInfrastructureException as ex: - return return_error(404, "Error stopping VM: %s" % ex.args[0]) + return return_error(404, "Error stopping VM: %s" % get_ex_error(ex)) except IncorrectInfrastructureException as ex: - return return_error(404, "Error stopping VM: %s" % ex.args[0]) + return return_error(404, "Error stopping VM: %s" % get_ex_error(ex)) except UnauthorizedUserException as ex: - return return_error(403, "Error stopping VM: %s" % ex.args[0]) + return return_error(403, "Error stopping VM: %s" % get_ex_error(ex)) except DeletedVMException as ex: - return return_error(404, "Error stopping VM: %s" % ex.args[0]) + return return_error(404, "Error stopping VM: %s" % get_ex_error(ex)) except IncorrectVMException as ex: - return return_error(404, "Error stopping VM: %s" % ex.args[0]) + return return_error(404, "Error stopping VM: %s" % get_ex_error(ex)) except Exception as ex: logger.exception("Error stopping VM") - return return_error(400, "Error stopping VM: %s" % ex.args[0]) + return return_error(400, "Error stopping VM: %s" % get_ex_error(ex)) @app.route('/infrastructures/:infid/vms/:vmid/reboot', method='PUT') @@ -946,18 +953,18 @@ def RESTRebootVM(infid=None, vmid=None): bottle.response.content_type = "text/plain" return InfrastructureManager.RebootVM(infid, vmid, auth) except DeletedInfrastructureException as ex: - return return_error(404, "Error rebooting VM: %s" % ex.args[0]) + return return_error(404, "Error rebooting VM: %s" % get_ex_error(ex)) except IncorrectInfrastructureException as ex: - return return_error(404, "Error rebooting VM: %s" % ex.args[0]) + return return_error(404, "Error rebooting VM: %s" % get_ex_error(ex)) except UnauthorizedUserException as ex: - return return_error(403, "Error rebooting VM: %s" % ex.args[0]) + return return_error(403, "Error rebooting VM: %s" % get_ex_error(ex)) except DeletedVMException as ex: - return return_error(404, "Error rebooting VM: %s" % ex.args[0]) + return return_error(404, "Error rebooting VM: %s" % get_ex_error(ex)) except IncorrectVMException as ex: - return return_error(404, "Error rebooting VM: %s" % ex.args[0]) + return return_error(404, "Error rebooting VM: %s" % get_ex_error(ex)) except Exception as ex: logger.exception("Error rebooting VM") - return return_error(400, "Error rebooting VM: %s" % ex.args[0]) + return return_error(400, "Error rebooting VM: %s" % get_ex_error(ex)) @app.route('/version', method='GET') @@ -966,7 +973,7 @@ def RESTGeVersion(): from IM import __version__ as version return format_output(version, field_name="version") except Exception as ex: - return return_error(400, "Error getting IM version: %s" % ex.args[0]) + return return_error(400, "Error getting IM version: %s" % get_ex_error(ex)) @app.route('/infrastructures/:infid/vms/:vmid/disks/:disknum/snapshot', method='PUT') @@ -996,18 +1003,18 @@ def RESTCreateDiskSnapshot(infid=None, vmid=None, disknum=None): return InfrastructureManager.CreateDiskSnapshot(infid, vmid, int(disknum), image_name, auto_delete, auth) except DeletedInfrastructureException as ex: - return return_error(404, "Error creating snapshot: %s" % ex.args[0]) + return return_error(404, "Error creating snapshot: %s" % get_ex_error(ex)) except IncorrectInfrastructureException as ex: - return return_error(404, "Error creating snapshot: %s" % ex.args[0]) + return return_error(404, "Error creating snapshot: %s" % get_ex_error(ex)) except UnauthorizedUserException as ex: - return return_error(403, "Error creating snapshot: %s" % ex.args[0]) + return return_error(403, "Error creating snapshot: %s" % get_ex_error(ex)) except DeletedVMException as ex: - return return_error(404, "Error creating snapshot: %s" % ex.args[0]) + return return_error(404, "Error creating snapshot: %s" % get_ex_error(ex)) except IncorrectVMException as ex: - return return_error(404, "Error creating snapshot: %s" % ex.args[0]) + return return_error(404, "Error creating snapshot: %s" % get_ex_error(ex)) except Exception as ex: logger.exception("Error creating snapshot") - return return_error(400, "Error creating snapshot: %s" % ex.args[0]) + return return_error(400, "Error creating snapshot: %s" % get_ex_error(ex)) @app.error(403) diff --git a/IM/ServiceRequests.py b/IM/ServiceRequests.py index fbd6c201e..f4b5a12e1 100644 --- a/IM/ServiceRequests.py +++ b/IM/ServiceRequests.py @@ -123,7 +123,7 @@ def _execute(self): return True except Exception as ex: logger.exception(self._error_mesage) - self.set("%s" % ex.args[0]) + self.set("%s" % getattr(ex, 'message', ex.args[0] if len(ex.args) else repr(ex))) return False From 6a902319d018d30edc378cab9b652054ba73ea45 Mon Sep 17 00:00:00 2001 From: micafer Date: Wed, 12 Jun 2019 12:03:57 +0200 Subject: [PATCH 4/5] Fix #856 --- IM/REST.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IM/REST.py b/IM/REST.py index 1c5262c20..d9739b894 100644 --- a/IM/REST.py +++ b/IM/REST.py @@ -308,7 +308,7 @@ def get_ex_error(ex): """ Return a secure string with the error of the exception in Py2 and Py3 """ - return getattr(ex, 'message', get_ex_error(ex) if len(ex.args) else repr(ex)) + return getattr(ex, 'message', ex.args[0] if len(ex.args) else repr(ex)) @app.route('/infrastructures/:infid', method='DELETE') From a2482d807d543375cf886cc9c37af76e8cd79f4d Mon Sep 17 00:00:00 2001 From: micafer Date: Thu, 13 Jun 2019 12:43:21 +0200 Subject: [PATCH 5/5] Update Changelog --- changelog | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/changelog b/changelog index ce7373a80..17ca1665b 100644 --- a/changelog +++ b/changelog @@ -505,3 +505,14 @@ IM 1.8.3: * Enable network creation in connectors EC2, OpenStack and GCE. * Fix error in openstack conn in case of setting auth data with a host without port. * Fix error in OpenNebula conn in case of error in function call. + +IM 1.8.4: + * Fix error 500 is returned in case of TOSCA parser errors. + * Fix error on infrastructure creation the VM status is unknown instead of pending. + * Fix error some floating IPs does not appear in the IM ctxt config files. + * Fix error adding a floating IP when there is a floating ip free. + * Change FogBow connector to new APIs (Buzios). + * Get last version of AppDB image in OCCI conn. + * Enable to add routes in GCE conn. + * Fix Issues with Ansible 2.8. + * Fix error creating FW in GCE conn if outports is empty.