From 753d94e44b73e444ff5e4012e8dba5a628ff0a11 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 1 Sep 2017 12:29:05 +0200 Subject: [PATCH] Fixing a keyerror for the IA WAN responses. Added error handling for the IA WAN responses. --- .../son_mano_slm/slm.py | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/plugins/son-mano-service-lifecycle-management/son_mano_slm/slm.py b/plugins/son-mano-service-lifecycle-management/son_mano_slm/slm.py index dd6278e..67bdba9 100644 --- a/plugins/son-mano-service-lifecycle-management/son_mano_slm/slm.py +++ b/plugins/son-mano-service-lifecycle-management/son_mano_slm/slm.py @@ -1876,10 +1876,14 @@ def wan_configure_response(self, ch, method, prop, payload): serv_id = tools.servid_from_corrid(self.services, prop.correlation_id) message = yaml.load(payload) - self.services[serv_id]['status'] = message['status'] - self.services[serv_id]['error'] = None - # TODO: handle negative status + LOG.info("Service " + serv_id + ": WAN configure request completed.") + + if message['message'] != '': + error = message['message'] + LOG.info('Error occured during WAN: ' + str(error)) + self.error_handling(serv_id, t.GK_CREATE, error) + self.start_next_task(serv_id) def wan_deconfigure(self, serv_id): @@ -1899,7 +1903,6 @@ def wan_deconfigure(self, serv_id): yaml.dump(message), correlation_id=corr_id) - def wan_deconfigure_response(self, ch, method, prop, payload): """ This method handles responses on the wan_deconfigure call @@ -1909,10 +1912,14 @@ def wan_deconfigure_response(self, ch, method, prop, payload): serv_id = tools.servid_from_corrid(self.services, prop.correlation_id) message = yaml.load(payload) - self.services[serv_id]['status'] = message['status'] - self.services[serv_id]['error'] = None - # TODO: handle negative status + LOG.info("Service " + serv_id + ": WAN deconfigure request completed.") + + if message['message'] != '': + error = message['message'] + LOG.info('Error occured during deconfiguring WAN: ' + str(error)) + self.error_handling(serv_id, t.GK_KILL, error) + self.start_next_task(serv_id) def stop_monitoring(self, serv_id):