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


Python config.register_root_helper函数代码示例

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


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

示例1: setup_conf

def setup_conf():
    """Setup the cfg for the clean up utility.

    Use separate setup_conf for the utility because there are many options
    from the main config that do not apply during clean-up.
    """

    cli_opts = [
        cfg.BoolOpt('force',
                    default=False,
                    help=_('Delete the namespace by removing all devices.')),
    ]

    opts = [
        cfg.StrOpt('dhcp_driver',
                   default='quantum.agent.linux.dhcp.Dnsmasq',
                   help=_("The driver used to manage the DHCP server.")),
    ]

    conf = cfg.CONF
    conf.register_cli_opts(cli_opts)
    conf.register_opts(opts)
    agent_config.register_root_helper(conf)
    conf.register_opts(dhcp.OPTS)
    return conf
开发者ID:wallnerryan,项目名称:quantum_migrate,代码行数:25,代码来源:netns_cleanup_util.py

示例2: setUp

    def setUp(self):
        super(TestDhcpAgentEventHandler, self).setUp()
        cfg.CONF.register_opts(dhcp_agent.DeviceManager.OPTS)
        cfg.CONF.register_opts(dhcp_agent.DhcpLeaseRelay.OPTS)
        cfg.CONF.set_override('interface_driver',
                              'quantum.agent.linux.interface.NullDriver')
        config.register_root_helper(cfg.CONF)
        cfg.CONF.register_opts(dhcp_agent.DhcpAgent.OPTS)

        self.plugin_p = mock.patch('quantum.agent.dhcp_agent.DhcpPluginApi')
        plugin_cls = self.plugin_p.start()
        self.plugin = mock.Mock()
        plugin_cls.return_value = self.plugin

        self.cache_p = mock.patch('quantum.agent.dhcp_agent.NetworkCache')
        cache_cls = self.cache_p.start()
        self.cache = mock.Mock()
        cache_cls.return_value = self.cache

        self.dhcp = dhcp_agent.DhcpAgent(HOSTNAME)
        self.call_driver_p = mock.patch.object(self.dhcp, 'call_driver')

        self.call_driver = self.call_driver_p.start()
        self.external_process_p = mock.patch(
            'quantum.agent.linux.external_process.ProcessManager'
        )
        self.external_process = self.external_process_p.start()
开发者ID:ericwanghp,项目名称:quantum,代码行数:27,代码来源:test_dhcp_agent.py

示例3: setup_conf

def setup_conf():
    """Setup the cfg for the clean up utility.

    Use separate setup_conf for the utility because there are many options
    from the main config that do not apply during clean-up.
    """

    opts = [
        cfg.StrOpt('dhcp_driver',
                   default='quantum.agent.linux.dhcp.Dnsmasq',
                   help=_("The driver used to manage the DHCP server.")),
        cfg.StrOpt('state_path',
                   default='.',
                   help=_('Top-level directory for maintaining dhcp state')),
        cfg.BoolOpt('force',
                    default=False,
                    help=_('Delete the namespace by removing all devices.')),
    ]

    conf = cfg.ConfigOpts()
    conf.register_opts(opts)
    agent_config.register_root_helper(conf)
    conf.register_opts(dhcp.OPTS)
    config.setup_logging(conf)
    return conf
开发者ID:bbrahmbhatt,项目名称:quantum,代码行数:25,代码来源:netns_cleanup_util.py

示例4: setUp

    def setUp(self):
        cfg.CONF.register_opts(dhcp_agent.DeviceManager.OPTS)
        cfg.CONF.set_override('interface_driver',
                              'quantum.agent.linux.interface.NullDriver')
        config.register_root_helper(cfg.CONF)
        cfg.CONF.register_opts(dhcp_agent.DhcpAgent.OPTS)
        self.notification_p = mock.patch(
            'quantum.agent.rpc.NotificationDispatcher')
        self.notification = self.notification_p.start()

        self.plugin_p = mock.patch('quantum.agent.dhcp_agent.DhcpPluginApi')
        plugin_cls = self.plugin_p.start()
        self.plugin = mock.Mock()
        plugin_cls.return_value = self.plugin

        self.cache_p = mock.patch('quantum.agent.dhcp_agent.NetworkCache')
        cache_cls = self.cache_p.start()
        self.cache = mock.Mock()
        cache_cls.return_value = self.cache

        self.dhcp = dhcp_agent.DhcpAgent(cfg.CONF)
        self.call_driver_p = mock.patch.object(self.dhcp, 'call_driver')

        self.call_driver = self.call_driver_p.start()
        self.external_process_p = mock.patch(
            'quantum.agent.linux.external_process.ProcessManager'
        )
        self.external_process = self.external_process_p.start()
开发者ID:koenning,项目名称:neutron,代码行数:28,代码来源:test_dhcp_agent.py

示例5: register_options

def register_options():
    cfg.CONF.register_opts(DhcpAgent.OPTS)
    config.register_agent_state_opts_helper(cfg.CONF)
    config.register_root_helper(cfg.CONF)
    cfg.CONF.register_opts(DeviceManager.OPTS)
    cfg.CONF.register_opts(DhcpLeaseRelay.OPTS)
    cfg.CONF.register_opts(dhcp.OPTS)
    cfg.CONF.register_opts(interface.OPTS)
开发者ID:CiscoAS,项目名称:quantum,代码行数:8,代码来源:dhcp_agent.py

示例6: main

def main():
    eventlet.monkey_patch()
    conf = cfg.CONF
    conf.register_opts(L3NATAgent.OPTS)
    config.register_root_helper(conf)
    conf.register_opts(interface.OPTS)
    conf.register_opts(external_process.OPTS)
    conf()
    config.setup_logging(conf)
    server = quantum_service.Service.create(binary='quantum-l3-agent',
                                            topic=topics.L3_AGENT)
    service.launch(server).wait()
开发者ID:bbrahmbhatt,项目名称:quantum,代码行数:12,代码来源:l3_agent.py

示例7: main

def main():
    eventlet.monkey_patch()
    cfg.CONF.register_opts(DhcpAgent.OPTS)
    config.register_root_helper(cfg.CONF)
    cfg.CONF.register_opts(DeviceManager.OPTS)
    cfg.CONF.register_opts(DhcpLeaseRelay.OPTS)
    cfg.CONF.register_opts(dhcp.OPTS)
    cfg.CONF.register_opts(interface.OPTS)
    cfg.CONF(project="quantum")
    config.setup_logging(cfg.CONF)

    mgr = DhcpAgent(cfg.CONF)
    mgr.run()
开发者ID:bbrahmbhatt,项目名称:quantum,代码行数:13,代码来源:dhcp_agent.py

示例8: setUp

 def setUp(self):
     root_helper_opt = [
         cfg.StrOpt('root_helper', default='sudo'),
     ]
     self.conf = config.setup_conf()
     self.conf.register_opts(interface.OPTS)
     config.register_root_helper(self.conf)
     self.ip_dev_p = mock.patch.object(ip_lib, 'IPDevice')
     self.ip_dev = self.ip_dev_p.start()
     self.ip_p = mock.patch.object(ip_lib, 'IPWrapper')
     self.ip = self.ip_p.start()
     self.device_exists_p = mock.patch.object(ip_lib, 'device_exists')
     self.device_exists = self.device_exists_p.start()
开发者ID:bbrahmbhatt,项目名称:quantum,代码行数:13,代码来源:test_linux_interface.py

示例9: initialize_app

 def initialize_app(self, argv):
     super(QuantumDebugShell, self).initialize_app(argv)
     if not self.options.config_file:
         raise exc.CommandError(
             _("You must provide a config file for bridge -"
               " either --config-file or env[QUANTUM_TEST_CONFIG_FILE]"))
     client = self.client_manager.quantum
     cfg.CONF.register_opts(interface.OPTS)
     cfg.CONF.register_opts(QuantumDebugAgent.OPTS)
     config.register_root_helper(cfg.CONF)
     cfg.CONF(['--config-file', self.options.config_file])
     config.setup_logging(cfg.CONF)
     driver = importutils.import_object(cfg.CONF.interface_driver, cfg.CONF)
     self.debug_agent = QuantumDebugAgent(cfg.CONF, client, driver)
开发者ID:AmirolAhmad,项目名称:quantum,代码行数:14,代码来源:shell.py

示例10: main

def main():
    eventlet.monkey_patch()

    conf = cfg.CONF
    config.register_root_helper(conf)
    conf.register_opts(ServiceAgent.OPTS)
    conf()
    config.setup_logging(conf)

    manager = 'quantum.agent.services.service_agent.ServiceAgent'
    server = quantum_service.Service.create(binary='quantum-svc-agent',
                                            topic=topics.SVC_AGENT,
                                            manager=manager)
    service.launch(server).wait()
开发者ID:kumarcv,项目名称:openstack-nf,代码行数:14,代码来源:service_agent.py

示例11: setUp

 def setUp(self):
     super(TestBase, self).setUp()
     self.conf = config.setup_conf()
     self.conf.register_opts(interface.OPTS)
     config.register_root_helper(self.conf)
     self.ip_dev_p = mock.patch.object(ip_lib, "IPDevice")
     self.ip_dev = self.ip_dev_p.start()
     self.addCleanup(self.ip_dev_p.stop)
     self.ip_p = mock.patch.object(ip_lib, "IPWrapper")
     self.ip = self.ip_p.start()
     self.addCleanup(self.ip_p.stop)
     self.device_exists_p = mock.patch.object(ip_lib, "device_exists")
     self.device_exists = self.device_exists_p.start()
     self.addCleanup(self.device_exists_p.stop)
开发者ID:CiscoAS,项目名称:quantum,代码行数:14,代码来源:test_linux_interface.py

示例12: main

def main():
    eventlet.monkey_patch()
    cfg.CONF.register_opts(DhcpAgent.OPTS)
    config.register_agent_state_opts_helper(cfg.CONF)
    config.register_root_helper(cfg.CONF)
    cfg.CONF.register_opts(DeviceManager.OPTS)
    cfg.CONF.register_opts(DhcpLeaseRelay.OPTS)
    cfg.CONF.register_opts(dhcp.OPTS)
    cfg.CONF.register_opts(interface.OPTS)
    cfg.CONF(project='quantum')
    config.setup_logging(cfg.CONF)
    server = quantum_service.Service.create(
        binary='quantum-dhcp-agent',
        topic=topics.DHCP_AGENT,
        report_interval=cfg.CONF.AGENT.report_interval)
    service.launch(server).wait()
开发者ID:Frostman,项目名称:quantum,代码行数:16,代码来源:dhcp_agent.py

示例13: main

def main():
    eventlet.monkey_patch()
    conf = cfg.CONF
    conf.register_opts(L3NATAgent.OPTS)
    config.register_agent_state_opts_helper(conf)
    config.register_root_helper(conf)
    conf.register_opts(interface.OPTS)
    conf.register_opts(external_process.OPTS)
    conf(project='quantum')
    config.setup_logging(conf)
    server = quantum_service.Service.create(
        binary='quantum-l3-agent',
        topic=topics.L3_AGENT,
        report_interval=cfg.CONF.AGENT.report_interval,
        manager='quantum.agent.l3_agent.L3NATAgentWithStateReport')
    service.launch(server).wait()
开发者ID:liqin75,项目名称:vse-vpnaas-plugin,代码行数:16,代码来源:l3_agent.py

示例14: main

def main():
    eventlet.monkey_patch()
    cfg.CONF.register_opts(OPTS)
    cfg.CONF.register_opts(manager.OPTS)
    # import interface options just in case the driver uses namespaces
    cfg.CONF.register_opts(interface.OPTS)
    config.register_root_helper(cfg.CONF)

    cfg.CONF(project='quantum')
    config.setup_logging(cfg.CONF)

    mgr = manager.LbaasAgentManager(cfg.CONF)
    svc = LbaasAgentService(
        host=cfg.CONF.host,
        topic=topics.LOADBALANCER_AGENT,
        manager=mgr
    )
    service.launch(svc).wait()
开发者ID:AmirolAhmad,项目名称:quantum,代码行数:18,代码来源:__init__.py

示例15: setup_conf

def setup_conf():
    """Setup the cfg for the clean up utility.

    Use separate setup_conf for the utility because there are many options
    from the main config that do not apply during clean-up.
    """
    opts = [
        cfg.BoolOpt('ovs_all_ports',
                    default=False,
                    help=_('True to delete all ports on all the OpenvSwitch '
                           'bridges. False to delete ports created by '
                           'Quantum on integration and external network '
                           'bridges.'))
    ]

    conf = cfg.CONF
    conf.register_cli_opts(opts)
    conf.register_opts(l3_agent.L3NATAgent.OPTS)
    conf.register_opts(interface.OPTS)
    agent_config.register_root_helper(conf)
    return conf
开发者ID:wdec,项目名称:quantum,代码行数:21,代码来源:ovs_cleanup_util.py


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