Exemple #1
0
def main():
    utils.read_config('designate', sys.argv)
    logging.setup('designate')

    server = sink_service.Service()
    service.serve(server, workers=CONF['service:sink'].workers)
    service.wait()
Exemple #2
0
def main():
    utils.read_config('designate', sys.argv)
    logging.setup('designate')

    server = sink_service.Service()
    service.serve(server, workers=CONF['service:sink'].workers)
    service.wait()
Exemple #3
0
def main():
    CONF(sys.argv[1:], project='oslo')
    logging.setup("oslo")

    with contextlib.closing(impl_zmq.ZmqProxy(CONF)) as reactor:
        reactor.consume_in_thread()
        reactor.wait()
Exemple #4
0
def main():
    utils.read_config("designate", sys.argv)
    logging.setup("designate")

    server = mdns_service.Service.create(binary="designate-mdns")
    service.serve(server, workers=CONF["service:mdns"].workers)
    service.wait()
Exemple #5
0
def main():
    utils.read_config('designate', sys.argv)
    logging.setup('designate')

    server = mdns_service.Service.create(binary='designate-mdns')
    service.serve(server, workers=CONF['service:mdns'].workers)
    service.wait()
Exemple #6
0
def main():
    utils.read_config('designate', sys.argv)
    logging.setup('designate')

    server = agent_service.Service.create(
        binary='designate-agent')
    service.serve(server, workers=CONF['service:agent'].workers)
    service.wait()
Exemple #7
0
def main():
    # TODO(kiall): Support passing --config-file and --config-dir to
    #              read_config
    utils.read_config('designate', [])
    logging.setup('designate')

    shell = DesignateShell()
    sys.exit(shell.run(sys.argv[1:]))
Exemple #8
0
def main():
    utils.read_config('designate', sys.argv)
    logging.setup('designate')

    server = central.Service.create(binary='designate-central',
                                    service_name='central')
    service.serve(server, workers=CONF['service:central'].workers)
    service.wait()
Exemple #9
0
def main():
    utils.read_config('designate', sys.argv)
    logging.setup('designate')

    server = pool_manager_service.Service.create(
        binary='designate-pool-manager')
    service.serve(server, workers=CONF['service:pool_manager'].workers)
    service.wait()
Exemple #10
0
def main():
    utils.read_config('designate', sys.argv)
    logging.setup('designate')

    rpc.init(CONF)

    launcher = service.launch(api_service.Service(),
                              CONF['service:api'].workers)
    launcher.wait()
Exemple #11
0
def main():
    utils.read_config('designate', sys.argv)
    logging.setup('designate')

    rpc.init(CONF)

    launcher = service.launch(api_service.Service(),
                              CONF['service:api'].workers)
    launcher.wait()
Exemple #12
0
def main():
    cfg.CONF.register_cli_opt(command_opt)

    utils.read_config('designate', sys.argv)
    logging.setup('designate')

    func_kwargs = {}
    for k in cfg.CONF.command.action_kwargs:
        v = getattr(cfg.CONF.command, 'action_kwarg_' + k)
        if v is None:
            continue
        func_kwargs[k] = strutils.safe_decode(v)
    func_args = [strutils.safe_decode(arg)
                 for arg in cfg.CONF.command.action_args]
    return cfg.CONF.command.action_fn(*func_args, **func_kwargs)
Exemple #13
0
def main():
    cfg.CONF.register_cli_opt(command_opt)

    utils.read_config('designate', sys.argv)
    logging.setup('designate')

    func_kwargs = {}
    for k in cfg.CONF.command.action_kwargs:
        v = getattr(cfg.CONF.command, 'action_kwarg_' + k)
        if v is None:
            continue
        func_kwargs[k] = strutils.safe_decode(v)
    func_args = [
        strutils.safe_decode(arg) for arg in cfg.CONF.command.action_args
    ]
    return cfg.CONF.command.action_fn(*func_args, **func_kwargs)
Exemple #14
0
def main():
    args = parse_args()
    logging.setup('cirrus_floatingip')
    LOG.logger.setLevel('DEBUG')
    load_config(args.config_file)

    kc = keystone_c.Client(username=args.username,
                           password=args.password,
                           tenant_name=args.tenantname,
                           auth_url=args.authurl,
                           endpoint_type=args.endpoint_type,
                           region_name=args.regionname)

    policy.init()
    rpc.init(cfg.CONF)
    context = DesignateContext.get_admin_context(tenant=kc.auth_tenant_id)

    handler = cirrus.CirrusFloatingIPHandler()

    args.func(kc, handler, context, args)
def main():
    args = parse_args()
    logging.setup('cirrus_floatingip')
    LOG.logger.setLevel('DEBUG')
    load_config(args.config_file)

    kc = keystone_c.Client(
        username=args.username,
        password=args.password,
        tenant_name=args.tenantname,
        auth_url=args.authurl,
        endpoint_type=args.endpoint_type,
        region_name=args.regionname)

    policy.init()
    rpc.init(cfg.CONF)
    context = DesignateContext.get_admin_context(tenant=kc.auth_tenant_id)

    handler = cirrus.CirrusFloatingIPHandler()

    args.func(kc, handler, context, args)
Exemple #16
0
def main():
    CONF.register_cli_opt(category_opt)

    try:
        utils.read_config('designate', sys.argv)
        logging.setup("designate")
    except cfg.ConfigFilesNotFoundError:
        cfgfile = CONF.config_file[-1] if CONF.config_file else None
        if cfgfile and not os.access(cfgfile, os.R_OK):
            st = os.stat(cfgfile)
            print(_("Could not read %s. Re-running with sudo") % cfgfile)
            try:
                os.execvp('sudo', ['sudo', '-u', '#%s' % st.st_uid] + sys.argv)
            except Exception:
                print(_('sudo failed, continuing as if nothing happened'))

        print(_('Please re-run designate-manage as root.'))
        sys.exit(2)

    fn = CONF.category.action_fn

    fn_args = fetch_func_args(fn)
    fn(*fn_args)
Exemple #17
0
    def sample(self, ctxt, publisher_id, event_type, payload, metadata):
        print "sample"
        pprint.pprint(payload)
	sys.stdout.flush()


TRANSPORT_ALIASES = {
    'designate.openstack.common.rpc.impl_kombu': 'rabbit',
    'designate.openstack.common.rpc.impl_qpid': 'qpid',
    'designate.openstack.common.rpc.impl_zmq': 'zmq',
    'designate.rpc.impl_kombu': 'rabbit',
    'designate.rpc.impl_qpid': 'qpid',
    'designate.rpc.impl_zmq': 'zmq',
}

utils.read_config('designate', sys.argv)
logging.setup('designate')

transport = messaging.get_transport(cfg.CONF, aliases=TRANSPORT_ALIASES)
targets = [
    messaging.Target(exchange='nova', topic='notifications'),
    messaging.Target(exchange='neutron', topic='notifications')
]
endpoints = [
    NotificationEndpoint()
]
server = messaging.get_notification_listener(transport, targets, endpoints)
server.start()
server.wait()
Exemple #18
0
def main():
    utils.read_config('designate', sys.argv)
    logging.setup('designate')
    launcher = service.launch(sink_service.Service(),
                              CONF['service:sink'].workers)
    launcher.wait()
Exemple #19
0
        pprint.pprint(payload)
        sys.stdout.flush()

    def sample(self, ctxt, publisher_id, event_type, payload, metadata):
        print "sample"
        pprint.pprint(payload)
        sys.stdout.flush()


TRANSPORT_ALIASES = {
    'designate.openstack.common.rpc.impl_kombu': 'rabbit',
    'designate.openstack.common.rpc.impl_qpid': 'qpid',
    'designate.openstack.common.rpc.impl_zmq': 'zmq',
    'designate.rpc.impl_kombu': 'rabbit',
    'designate.rpc.impl_qpid': 'qpid',
    'designate.rpc.impl_zmq': 'zmq',
}

utils.read_config('designate', sys.argv)
logging.setup('designate')

transport = messaging.get_transport(cfg.CONF, aliases=TRANSPORT_ALIASES)
targets = [
    messaging.Target(exchange='nova', topic='notifications'),
    messaging.Target(exchange='neutron', topic='notifications')
]
endpoints = [NotificationEndpoint()]
server = messaging.get_notification_listener(transport, targets, endpoints)
server.start()
server.wait()