def sandesh_alarm_ack_request_handler(self, sandesh_req):
     response_code = SandeshAlarmAckResponseCode.CALLBACK_NOT_REGISTERED
     alarm_callback = self._sandesh.alarm_ack_callback()
     if alarm_callback:
         response_code = alarm_callback(sandesh_req)
     status = True
     err_msg = None
     if response_code != SandeshAlarmAckResponseCode.SUCCESS:
         status = False
         try:
             err_msg = SandeshAlarmAckResponseError[response_code]
         except KeyError:
             self._sandesh.logger().error('Invalid AlarmAck response code:'
                                          ' %s' % str(response_code))
             response_code = SandeshAlarmAckResponseCode.UNKNOWN_ERROR
             err_msg = SandeshAlarmAckResponseError[response_code]
     ack_response = SandeshAlarmAckResponse(status, err_msg)
     ack_response.response(sandesh_req.context(), sandesh=self._sandesh)
Example #2
0
 def sandesh_alarm_ack_request_handler(self, sandesh_req):
     response_code = SandeshAlarmAckResponseCode.CALLBACK_NOT_REGISTERED
     alarm_callback = self._sandesh.alarm_ack_callback()
     if alarm_callback:
         response_code = alarm_callback(sandesh_req)
     status = True
     err_msg = None
     if response_code != SandeshAlarmAckResponseCode.SUCCESS:
         status = False
         try:
             err_msg = SandeshAlarmAckResponseError[response_code]
         except KeyError:
             self._sandesh.logger().error('Invalid AlarmAck response code:'
                                          ' %s' % str(response_code))
             response_code = SandeshAlarmAckResponseCode.UNKNOWN_ERROR
             err_msg = SandeshAlarmAckResponseError[response_code]
     ack_response = SandeshAlarmAckResponse(status, err_msg)
     ack_response.response(sandesh_req.context())