def dfa_server():
    try:
        cfg = config.CiscoDFAConfig().cfg
        logging.setup_logger('dfa_enabler', cfg)
        dfa = DfaServer(cfg)
        save_my_pid(cfg)
        dfa.create_threads()
        while True:
            time.sleep(constants.MAIN_INTERVAL)
            if dfa.dcnm_dhcp:
                dfa.update_port_ip_address()
            else:
                dfa.check_dhcp_ports()
            for trd in dfa.dfa_threads:
                if not trd.am_i_active:
                    LOG.info(_LI("Thread %s is not active."), trd.name)
                try:
                    exc = trd._excq.get(block=False)
                except queue.Empty:
                    pass
                else:
                    trd_name = eval(exc).get('name')
                    exc_tb = eval(exc).get('tb')
                    LOG.error(_LE('Exception occurred in %(name)s thread. '
                                  '%(tb)s'), {'name': trd_name, 'tb': exc_tb})
            # Check on dfa agents
            cur_time = time.time()
            for agent, time_s in six.iteritems(dfa.agents_status_table):
                last_seen = time.mktime(time.strptime(time_s))
                if abs(cur_time - last_seen -
                       constants.MAIN_INTERVAL) > constants.HB_INTERVAL:
                    LOG.error(_LE("Agent on %(host)s is not seen for %(sec)s. "
                              "Last seen was %(time)s."),
                              {'host': agent,
                               'sec': abs(cur_time - last_seen),
                               'time': time_s})

    except Exception as exc:
        LOG.exception(_LE("ERROR: %s"), exc)

    except __HOLE__:
        pass
dataset/ETHPy150Open openstack/networking-cisco/networking_cisco/apps/saf/server/dfa_server.py/dfa_server