예제 #1
0
 def _process_event_cb(self, fid, chp_event, chp_type, chp_pid):
     LOG.info('fid=%s, chp_event=%s', fid, chp_event)
     self.queue.put(
         ProcessEvent(
             ConfHaProcess(chp_event=chp_event,
                           chp_type=chp_type,
                           chp_pid=chp_pid,
                           fid=fid)))
예제 #2
0
 def _process_event_cb(self, fid, chp_event, chp_type, chp_pid):
     logging.info('fid=%s, chp_event=%s', fid, chp_event)
     self.queue.put(
         ProcessEvent(
             ConfHaProcess(chp_event=chp_event,
                           chp_type=chp_type,
                           chp_pid=chp_pid,
                           fid=fid)))
     if chp_event == 3:
         self.queue.put(
             BroadcastHAStates(states=[HAState(fid=fid, status='offline')],
                               reply_to=None))
예제 #3
0
 def _process_event_cb(self, fid, chp_event, chp_type, chp_pid):
     LOG.info('fid=%s, chp_event=%s', fid, chp_event)
     self.queue.put(
         ProcessEvent(
             ConfHaProcess(chp_event=chp_event,
                           chp_type=chp_type,
                           chp_pid=chp_pid,
                           fid=fid)))
     if chp_event == 3:
         self.queue.put(
             BroadcastHAStates(
                 states=[HAState(fid=fid, status=ServiceHealth.FAILED)],
                 reply_to=None))
예제 #4
0
    def _process_event_cb(self, fid, chp_event, chp_type, chp_pid):
        LOG.info('fid=%s, chp_event=%s', fid, chp_event)
        self.planner.add_command(
            ProcessEvent(
                ConfHaProcess(chp_event=chp_event,
                              chp_type=chp_type,
                              chp_pid=chp_pid,
                              fid=fid)))

        if chp_event == m0HaProcessEvent.M0_CONF_HA_PROCESS_STOPPED:
            proc_ep = self.consul_util.fid_to_endpoint(fid)
            if proc_ep:
                self._ffi.hax_link_stopped(self._ha_ctx, make_c_str(proc_ep))
예제 #5
0
    def _process_event_cb(self, fid, chp_event, chp_type, chp_pid):
        LOG.info('fid=%s, chp_event=%s', fid, chp_event)
        self.queue.put(
            ProcessEvent(
                ConfHaProcess(chp_event=chp_event,
                              chp_type=chp_type,
                              chp_pid=chp_pid,
                              fid=fid)))

        if chp_type == m0HaProcessType.M0_CONF_HA_PROCESS_M0D:
            if chp_event == m0HaProcessEvent.M0_CONF_HA_PROCESS_STARTED:
                self.queue.put(
                    BroadcastHAStates(
                        states=[HAState(fid=fid, status=ServiceHealth.OK)],
                        reply_to=None))
예제 #6
0
def process_event():
    return ProcessEvent(
               ConfHaProcess(chp_event=0,
                             chp_type=0,
                             chp_pid=0,
                             fid=Fid(0, 0)))