def _send_presence(self, msg):
        '''
        Forward an presence message to all subscribed yards
        Presence message has a route
        '''
        y_name = msg['route']['src'][1]
        if y_name not in self.lane_stack.value.nameRemotes:  # subscriber not a remote
            pass  # drop msg don't answer
        else:
            if 'data' in msg and 'state' in msg['data']:
                state = msg['data']['state']
            else:
                state = None

            # create answer message
            if state in [None, 'available', 'present']:
                present = odict()
                for name in self.availables.value:
                    minion = self.aliveds.value.get(name, None)
                    present[name] = minion.ha[0] if minion else None
                data = {'present': present}
            else:
                # TODO: update to really return joineds
                states = {'joined': self.alloweds,
                          'allowed': self.alloweds,
                          'alived': self.aliveds,
                          'reaped': self.reapeds}
                try:
                    minions = states[state].value
                except __HOLE__:
                    # error: wrong/unknown state requested
                    log.error('Lane Router Received invalid message: {0}'.format(msg))
                    return

                result = odict()
                for name in minions:
                    result[name] = minions[name].ha[0]
                data = {state: result}

            tag = tagify('present', 'presence')
            route = {'dst': (None, None, 'event_fire'),
                     'src': (None, self.lane_stack.value.local.name, None)}
            msg = {'route': route, 'tag': tag, 'data': data}
            self.lane_stack.value.transmit(msg,
                                           self.lane_stack.value.fetchUidByName(y_name))
            self.lane_stack.value.serviceAll()
dataset/ETHPy150Open saltstack/salt/salt/daemons/flo/core.py/SaltRaetPresenter._send_presence