当前位置: 首页>>代码示例>>Python>>正文


Python utils.log_opt_values函数代码示例

本文整理汇总了Python中neutron.common.utils.log_opt_values函数的典型用法代码示例。如果您正苦于以下问题:Python log_opt_values函数的具体用法?Python log_opt_values怎么用?Python log_opt_values使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了log_opt_values函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: main

def main():
    # this is from neutron.plugins.ml2.drivers.openvswitch.agent.main
    common_config.init(sys.argv[1:])
    n_utils.log_opt_values(LOG)
    common_config.setup_logging()
    # this is from neutron.plugins.ml2.drivers.openvswitch.agent.openflow.
    # ovs_ofctl.main
    bridge_classes = {
        'br_int': br_int.OVSIntegrationBridge,
        'br_phys': br_phys.OVSPhysicalBridge,
        'br_tun': br_tun.OVSTunnelBridge,
    }
    # this is from neutron.plugins.ml2.drivers.openvswitch.agent.
    # ovs_neutron_agent
    try:
        agent_config = create_agent_config_map(cfg.CONF)
    except ValueError:
        LOG.exception(_LE("Agent failed to create agent config map"))
        raise SystemExit(1)
    prepare_xen_compute()
    validate_local_ip(agent_config['local_ip'])
    try:
        agent = OVSBagpipeNeutronAgent(bridge_classes, **agent_config)
    except (RuntimeError, ValueError) as e:
        LOG.error(_LE("%s Agent terminated!"), e)
        sys.exit(1)
    agent.daemon_loop()
开发者ID:nikesh-mahalka,项目名称:networking-bgpvpn,代码行数:27,代码来源:ovs_bagpipe_neutron_agent.py

示例2: main

def main():
    eventlet.monkey_patch()
    opts = [
        cfg.StrOpt('network_id'),
        cfg.StrOpt('router_id'),
        cfg.StrOpt('pid_file'),
        cfg.BoolOpt('daemonize', default=True),
        cfg.IntOpt('metadata_port',
                   default=9697,
                   help=_("TCP Port to listen for metadata server "
                          "requests.")),
    ]

    cfg.CONF.register_cli_opts(opts)
    # Don't get the default configuration file
    cfg.CONF(project='neutron', default_config_files=[])
    config.setup_logging(cfg.CONF)
    utils.log_opt_values(LOG)
    proxy = ProxyDaemon(cfg.CONF.pid_file,
                        cfg.CONF.metadata_port,
                        network_id=cfg.CONF.network_id,
                        router_id=cfg.CONF.router_id)

    if cfg.CONF.daemonize:
        proxy.start()
    else:
        proxy.run()
开发者ID:Brocade-OpenSource,项目名称:OpenStack-DNRM-Neutron,代码行数:27,代码来源:namespace_proxy.py

示例3: main

def main():
    cfg.CONF.register_opts(ip_lib.OPTS)
    cfg.CONF.register_opts(dhcp_config.DHCP_OPTS)
    config.register_root_helper(cfg.CONF)
    common_config.init(sys.argv[1:])
    common_config.setup_logging()
    q_utils.log_opt_values(LOG)

    try:
        agent_config = create_agent_config_map(cfg.CONF)
    except ValueError as e:
        LOG.error(_('%s Agent terminated!'), e)
        sys.exit(1)

    is_xen_compute_host = 'rootwrap-xen-dom0' in cfg.CONF.AGENT.root_helper
    if is_xen_compute_host:
        # Force ip_lib to always use the root helper to ensure that ip
        # commands target xen dom0 rather than domU.
        cfg.CONF.set_default('ip_lib_force_root', True)
    try:
        agent = GBPOvsAgent(root_helper=cfg.CONF.AGENT.root_helper,
                            **agent_config)
    except RuntimeError as e:
        LOG.error(_("%s Agent terminated!"), e)
        sys.exit(1)
    signal.signal(signal.SIGTERM, agent._handle_sigterm)

    # Start everything.
    LOG.info(_("Agent initialized successfully, now running... "))
    agent.daemon_loop()
开发者ID:AKamyshnikova,项目名称:python-opflex-agent,代码行数:30,代码来源:gbp_ovs_agent.py

示例4: main

def main():
    common_config.init(sys.argv[1:])
    common_config.setup_logging()
    q_utils.log_opt_values(LOG)
    bridge_classes = {
        'br_int': br_int.OVSIntegrationBridge,
        'br_phys': br_phys.OVSPhysicalBridge,
        'br_tun': br_tun.OVSTunnelBridge,
    }

    ovs_neutron_agent.prepare_xen_compute()
    ovs_neutron_agent.validate_tunnel_config(
        cfg.CONF.AGENT.tunnel_types,
        cfg.CONF.OVS.local_ip
    )

    try:
        agent = OVSSfcAgent(bridge_classes, cfg.CONF)
    except (RuntimeError, ValueError) as e:
        LOG.exception(e)
        LOG.error(_LE('Agent terminated!'))
        sys.exit(1)

    LOG.info(_LI("Agent initialized successfully, now running... "))
    agent.daemon_loop()
开发者ID:CNlukai,项目名称:networking-sfc,代码行数:25,代码来源:agent.py

示例5: main

def main():
    opts = [
        cfg.StrOpt("network_id", help=_("Network that will have instance metadata " "proxied.")),
        cfg.StrOpt("router_id", help=_("Router that will have connected instances' " "metadata proxied.")),
        cfg.StrOpt("pid_file", help=_("Location of pid file of this process.")),
        cfg.BoolOpt("daemonize", default=True, help=_("Run as daemon.")),
        cfg.IntOpt("metadata_port", default=9697, help=_("TCP Port to listen for metadata server " "requests.")),
        cfg.StrOpt(
            "metadata_proxy_socket",
            default="$state_path/metadata_proxy",
            help=_("Location of Metadata Proxy UNIX domain " "socket"),
        ),
    ]

    cfg.CONF.register_cli_opts(opts)
    # Don't get the default configuration file
    cfg.CONF(project="neutron", default_config_files=[])
    config.setup_logging()
    utils.log_opt_values(LOG)
    proxy = ProxyDaemon(
        cfg.CONF.pid_file, cfg.CONF.metadata_port, network_id=cfg.CONF.network_id, router_id=cfg.CONF.router_id
    )

    if cfg.CONF.daemonize:
        proxy.start()
    else:
        proxy.run()
开发者ID:cboling,项目名称:SDNdbg,代码行数:27,代码来源:namespace_proxy.py

示例6: main

def main():
    cfg.CONF.register_opts(ip_lib.OPTS)
    config.register_root_helper(cfg.CONF)
    common_config.init(sys.argv[1:])
    common_config.setup_logging()
    q_utils.log_opt_values(LOG)
    bridge_classes = {
            'br_int': df_ovs_bridge.DFOVSAgentBridge,
            'br_phys': br_phys.OVSPhysicalBridge,
            'br_tun': br_tun.OVSTunnelBridge
                }
    try:
        agent_config = ona.create_agent_config_map(cfg.CONF)
    except ValueError as e:
        LOG.error(_LE('%s Agent terminated!'), e)
        sys.exit(1)

    is_xen_compute_host = 'rootwrap-xen-dom0' in cfg.CONF.AGENT.root_helper
    if is_xen_compute_host:
        # Force ip_lib to always use the root helper to ensure that ip
        # commands target xen dom0 rather than domU.
        cfg.CONF.set_default('ip_lib_force_root', True)

    agent = L2OVSControllerAgent(bridge_classes, **agent_config)

    signal.signal(signal.SIGTERM, agent._handle_sigterm)

    # Start everything.
    LOG.info(_LI("Agent initialized successfully, now running... "))
    agent.daemon_loop()
开发者ID:xujinrong,项目名称:dragonflow,代码行数:30,代码来源:ovs_dragonflow_neutron_agent.py

示例7: main

def main():
    opts = [
        cfg.StrOpt('network_id',
                   help=_('Network that will have instance metadata '
                          'proxied.')),
        cfg.StrOpt('router_id',
                   help=_('Router that will have connected instances\' '
                          'metadata proxied.')),
        cfg.StrOpt('pid_file',
                   help=_('Location of pid file of this process.')),
        cfg.BoolOpt('daemonize',
                    default=False,
                    help=_('Run as daemon.')),
        cfg.StrOpt('metadata_host',
                   default="0.0.0.0",
                   help=_("IP address to listen for metadata server "
                          "requests.")),
        cfg.IntOpt('metadata_port',
                   default=9697,
                   help=_("TCP Port to listen for metadata server "
                          "requests.")),
        cfg.StrOpt('metadata_proxy_socket',
                   default='$state_path/metadata_proxy',
                   help=_('Location of Metadata Proxy UNIX domain '
                          'socket')),
        cfg.StrOpt('metadata_proxy_user',
                   default=None,
                   help=_("User (uid or name) running metadata proxy after "
                          "its initialization")),
        cfg.StrOpt('metadata_proxy_group',
                   default=None,
                   help=_("Group (gid or name) running metadata proxy after "
                          "its initialization")),
        cfg.BoolOpt('metadata_proxy_watch_log',
                    default=True,
                    help=_("Watch file log. Log watch should be disabled when "
                           "metadata_proxy_user/group has no read/write "
                           "permissions on metadata proxy log file.")),
    ]

    cfg.CONF.register_cli_opts(opts)
    # Don't get the default configuration file
    cfg.CONF(project='neutron', default_config_files=[])
    config.setup_logging()
    utils.log_opt_values(LOG)

    proxy = ProxyDaemon(cfg.CONF.pid_file,
                        cfg.CONF.metadata_port,
                        network_id=cfg.CONF.network_id,
                        router_id=cfg.CONF.router_id,
                        user=cfg.CONF.metadata_proxy_user,
                        group=cfg.CONF.metadata_proxy_group,
                        watch_log=cfg.CONF.metadata_proxy_watch_log,
                        host=cfg.CONF.metadata_host)

    if cfg.CONF.daemonize:
        proxy.start()
    else:
        proxy.run()
开发者ID:Kiran-r,项目名称:apic-ml2-driver,代码行数:59,代码来源:namespace_proxy.py

示例8: main

def main():
    common_config.init(sys.argv[1:])
    driver_name = cfg.CONF.OVS.of_interface
    mod_name = _main_modules[driver_name]
    mod = importutils.import_module(mod_name)
    mod.init_config()
    common_config.setup_logging()
    n_utils.log_opt_values(LOG)
    mod.main()
开发者ID:cisco-openstack,项目名称:neutron,代码行数:9,代码来源:main.py

示例9: main

def main():
    config.init(sys.argv[1:])
    config.setup_logging()
    n_utils.log_opt_values(LOG)
    if not CONF.config_file:
        sys.exit(_("ERROR: Unable to find configuration file via the default"
                   " search paths (~/.neutron/, ~/, /etc/neutron/, /etc/) and"
                   " the '--config-file' option!"))
    run()
开发者ID:Anonymike,项目名称:quark,代码行数:9,代码来源:agent.py

示例10: main

def main():
    eventlet.monkey_patch()
    cfg.CONF.register_opts(UnixDomainMetadataProxy.OPTS)
    cfg.CONF.register_opts(MetadataProxyHandler.OPTS)
    cfg.CONF(project='neutron')
    config.setup_logging(cfg.CONF)
    utils.log_opt_values(LOG)
    proxy = UnixDomainMetadataProxy(cfg.CONF)
    proxy.run()
开发者ID:vnaum,项目名称:neutron,代码行数:9,代码来源:agent.py

示例11: main

def main():
    cfg.CONF.register_opts(metadata_conf.UNIX_DOMAIN_METADATA_PROXY_OPTS)
    cfg.CONF.register_opts(metadata_conf.METADATA_PROXY_HANDLER_OPTS)
    cache.register_oslo_configs(cfg.CONF)
    cfg.CONF.set_default(name='cache_url', default='memory://?default_ttl=5')
    agent_conf.register_agent_state_opts_helper(cfg.CONF)
    config.init(sys.argv[1:])
    config.setup_logging()
    utils.log_opt_values(LOG)
    proxy = agent.UnixDomainMetadataProxy(cfg.CONF)
    proxy.run()
开发者ID:bradleyjones,项目名称:neutron,代码行数:11,代码来源:metadata_agent.py

示例12: main

def main():
    meta.register_meta_conf_opts(meta.SHARED_OPTS)
    meta.register_meta_conf_opts(meta.UNIX_DOMAIN_METADATA_PROXY_OPTS)
    meta.register_meta_conf_opts(meta.METADATA_PROXY_HANDLER_OPTS)
    cache.register_oslo_configs(cfg.CONF)
    agent_conf.register_agent_state_opts_helper(cfg.CONF)
    config.init(sys.argv[1:])
    config.setup_logging()
    utils.log_opt_values(LOG)
    proxy = agent.UnixDomainMetadataProxy(cfg.CONF)
    proxy.run()
开发者ID:cubeek,项目名称:neutron,代码行数:11,代码来源:metadata_agent.py

示例13: main

def main():
    cfg.CONF.register_opts(UnixDomainMetadataProxy.OPTS)
    cfg.CONF.register_opts(MetadataProxyHandler.OPTS)
    cache.register_oslo_configs(cfg.CONF)
    cfg.CONF.set_default(name='cache_url', default='memory://?default_ttl=5')
    agent_conf.register_agent_state_opts_helper(cfg.CONF)
    config.init(sys.argv[1:])
    config.setup_logging()
    utils.log_opt_values(LOG)
    proxy = UnixDomainMetadataProxy(cfg.CONF)
    proxy.run()
开发者ID:leesurezen,项目名称:neutron,代码行数:11,代码来源:agent.py

示例14: main

def main():
    opts = [
        cfg.StrOpt("network_id", help=_("Network that will have instance metadata " "proxied.")),
        cfg.StrOpt("router_id", help=_("Router that will have connected instances' " "metadata proxied.")),
        cfg.StrOpt("pid_file", help=_("Location of pid file of this process.")),
        cfg.BoolOpt("daemonize", default=True, help=_("Run as daemon.")),
        cfg.IntOpt("metadata_port", default=9697, help=_("TCP Port to listen for metadata server " "requests.")),
        cfg.StrOpt(
            "metadata_proxy_socket",
            default="$state_path/metadata_proxy",
            help=_("Location of Metadata Proxy UNIX domain " "socket"),
        ),
        cfg.StrOpt(
            "metadata_proxy_user",
            default=None,
            help=_("User (uid or name) running metadata proxy after " "its initialization"),
        ),
        cfg.StrOpt(
            "metadata_proxy_group",
            default=None,
            help=_("Group (gid or name) running metadata proxy after " "its initialization"),
        ),
        cfg.BoolOpt(
            "metadata_proxy_watch_log",
            default=True,
            help=_(
                "Watch file log. Log watch should be disabled when "
                "metadata_proxy_user/group has no read/write "
                "permissions on metadata proxy log file."
            ),
        ),
    ]

    cfg.CONF.register_cli_opts(opts)
    # Don't get the default configuration file
    cfg.CONF(project="neutron", default_config_files=[])
    config.setup_logging()
    utils.log_opt_values(LOG)

    proxy = ProxyDaemon(
        cfg.CONF.pid_file,
        cfg.CONF.metadata_port,
        network_id=cfg.CONF.network_id,
        router_id=cfg.CONF.router_id,
        user=cfg.CONF.metadata_proxy_user,
        group=cfg.CONF.metadata_proxy_group,
        watch_log=cfg.CONF.metadata_proxy_watch_log,
    )

    if cfg.CONF.daemonize:
        proxy.start()
    else:
        proxy.run()
开发者ID:yizhongyin,项目名称:OpenstackLiberty,代码行数:53,代码来源:namespace_proxy.py

示例15: main

def main():
    eventlet.monkey_patch()
    cfg.CONF.register_opts(UnixDomainMetadataProxy.OPTS)
    cfg.CONF.register_opts(MetadataProxyHandler.OPTS)
    cache.register_oslo_configs(cfg.CONF)
    cfg.CONF.set_default(name='cache_url', default='')
    agent_conf.register_agent_state_opts_helper(cfg.CONF)
    cfg.CONF(project='neutron')
    config.setup_logging(cfg.CONF)
    utils.log_opt_values(LOG)
    proxy = UnixDomainMetadataProxy(cfg.CONF)
    proxy.run()
开发者ID:VeenaSL,项目名称:sriov,代码行数:12,代码来源:agent.py


注:本文中的neutron.common.utils.log_opt_values函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。