예제 #1
0
def main():
    # Parse config file and command line options, then start logging
    inventory_service.prepare_service(sys.argv)

    mgr = rpc_service.RPCService(CONF.host, 'inventory.conductor.manager',
                                 'ConductorManager')

    launcher = service.launch(CONF, mgr)
    launcher.wait()
예제 #2
0
def main():
    # Parse config file and command line options, then start logging
    inventory_service.prepare_service(sys.argv)

    # connection is based upon host and MANAGER_TOPIC
    mgr = rpc_service.RPCService(CONF.host, 'inventory.agent.manager',
                                 'AgentManager')
    launcher = service.launch(CONF, mgr)
    launcher.wait()
예제 #3
0
def main():
    # Parse config file and command line options, then start logging
    # The mac is to be truncated to 17 characters, which is the proper
    # length of a mac address, in order to handle IPv6 where a DUID
    # is provided instead of a mac address.  The truncated DUID is
    # then equivalent to the mac address.
    inventory_service.prepare_service(sys.argv)

    LOG = log.getLogger(__name__)

    if CONF.action.name in ['add', 'del', 'old']:
        msg = (_("Called '%(action)s' for mac '%(mac)s' with ip '%(ip)s'") % {
            "action": CONF.action.name,
            "mac": CONF.action.mac[-17:],
            "ip": CONF.action.ip
        })
        LOG.info(msg)
        CONF.action.func(CONF.action.mac[-17:], CONF.action.ip)
    else:
        LOG.error(
            _("Unknown action: %(action)") % {"action": CONF.action.name})