Skip to content

Commit

Permalink
Merge pull request #237 from tsoenen/master
Browse files Browse the repository at this point in the history
Fix for keyerror on IA WAN call. Error handling for IA WAN call.
  • Loading branch information
tsoenen authored Sep 1, 2017
2 parents a35bc4b + 9d4ce89 commit 0815fc0
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions plugins/son-mano-service-lifecycle-management/son_mano_slm/slm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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
Expand All @@ -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):
Expand Down

0 comments on commit 0815fc0

Please sign in to comment.