import os
import eventlet
+eventlet.monkey_patch()
+
import netaddr
from oslo.config import cfg
def main():
- eventlet.monkey_patch()
register_options()
cfg.CONF(project='neutron')
config.setup_logging(cfg.CONF)
#
import eventlet
+eventlet.monkey_patch()
+
import netaddr
from oslo.config import cfg
def main(manager='neutron.agent.l3_agent.L3NATAgentWithStateReport'):
- eventlet.monkey_patch()
conf = cfg.CONF
conf.register_opts(L3NATAgent.OPTS)
config.register_interface_driver_opts_helper(conf)
import socket
import eventlet
+eventlet.monkey_patch()
+
import httplib2
from neutronclient.v2_0 import client
from oslo.config import cfg
def main():
- eventlet.monkey_patch()
cfg.CONF.register_opts(UnixDomainMetadataProxy.OPTS)
cfg.CONF.register_opts(MetadataProxyHandler.OPTS)
cache.register_oslo_configs(cfg.CONF)
import socket
import eventlet
+eventlet.monkey_patch()
+
import httplib2
from oslo.config import cfg
import six.moves.urllib.parse as urlparse
def main():
- eventlet.monkey_patch()
opts = [
cfg.StrOpt('network_id',
help=_('Network that will have instance metadata '
import re
import eventlet
+eventlet.monkey_patch()
+
from oslo.config import cfg
from neutron.agent.common import config as agent_config
installation as it will blindly purge namespaces and their devices. This
option also kills any lingering DHCP instances.
"""
- eventlet.monkey_patch()
-
conf = setup_conf()
conf()
config.setup_logging(conf)
# under the License.
# @author: Kevin Benton, kevin.benton@bigswitch.com
-import eventlet
import sys
import time
+import eventlet
+eventlet.monkey_patch()
+
from oslo.config import cfg
from neutron.agent.linux import ovs_lib
def main():
- eventlet.monkey_patch()
cfg.CONF(project='neutron')
config.setup_logging(cfg.CONF)
pl_config.register_config()
# @author: Pedro Navarro Perez
# @author: Alessandro Pilotti, Cloudbase Solutions Srl
-import eventlet
import platform
import re
import time
+import eventlet
+eventlet.monkey_patch()
+
from oslo.config import cfg
from neutron.agent.common import config
def main():
- eventlet.monkey_patch()
cfg.CONF(project='neutron')
logging_config.setup_logging(cfg.CONF)
import time
import eventlet
+eventlet.monkey_patch()
+
from oslo.config import cfg
from neutron.agent.linux import ip_lib
def main():
- eventlet.monkey_patch()
cfg.CONF.register_opts(ip_lib.OPTS)
cfg.CONF(project='neutron')
logging_config.setup_logging(cfg.CONF)
import time
import eventlet
+eventlet.monkey_patch()
+
from oslo.config import cfg
from neutron.agent import l2population_rpc as l2pop_rpc
def main():
- eventlet.monkey_patch()
cfg.CONF(project='neutron')
logging_config.setup_logging(cfg.CONF)
import time
import eventlet
+eventlet.monkey_patch()
+
from oslo.config import cfg
from neutron.agent import rpc as agent_rpc
def main():
- eventlet.monkey_patch()
cfg.CONF(project='neutron')
logging_config.setup_logging(cfg.CONF)
import time
import eventlet
+eventlet.monkey_patch()
from neutron.agent.linux import ovs_lib
from neutron.agent import rpc as agent_rpc
def main():
- eventlet.monkey_patch()
-
config.CONF(project='neutron')
logging_config.setup_logging(config.CONF)
import time
import eventlet
+eventlet.monkey_patch()
from neutron.agent.linux import ovs_lib
from neutron.agent import rpc as agent_rpc
def main():
- eventlet.monkey_patch()
config.CONF(project='neutron')
logging_config.setup_logging(config.CONF)
import time
import eventlet
+eventlet.monkey_patch()
+
import netaddr
from oslo.config import cfg
from six import moves
def main():
- eventlet.monkey_patch()
cfg.CONF.register_opts(ip_lib.OPTS)
cfg.CONF(project='neutron')
logging_config.setup_logging(cfg.CONF)
import time
import eventlet
+eventlet.monkey_patch()
+
from oslo.config import cfg
from ryu.app import client
from ryu.app import conf_switch_key
def main():
- eventlet.monkey_patch()
cfg.CONF(project='neutron')
logging_config.setup_logging(cfg.CONF)
# under the License.
#
-import eventlet
import time
+import eventlet
+eventlet.monkey_patch()
+
from neutron.openstack.common import log as logging
from neutron.plugins.vmware.api_client import base
from neutron.plugins.vmware.api_client import eventlet_request
-eventlet.monkey_patch()
LOG = logging.getLogger(__name__)
# If ../neutron/__init__.py exists, add ../ to Python search path, so that
# it will override what happens to be installed in /usr/(local/)lib/python...
-import eventlet
import sys
+import eventlet
+eventlet.monkey_patch()
+
from oslo.config import cfg
from neutron.common import config
def main():
- eventlet.monkey_patch()
-
# the configuration will be read into the cfg.CONF global data structure
config.parse(sys.argv[1:])
if not cfg.CONF.config_file:
#
import eventlet
+eventlet.monkey_patch()
+
import netaddr
from oslo.config import cfg
def main():
- eventlet.monkey_patch()
conf = cfg.CONF
conf.register_opts(vArmourL3NATAgent.OPTS)
config.register_interface_driver_opts_helper(conf)
# @author: Mark McClain, DreamHost
import eventlet
+eventlet.monkey_patch()
+
from oslo.config import cfg
from neutron.agent.common import config
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
import eventlet
+eventlet.monkey_patch(thread=True)
+
from oslo.config import cfg
from neutron.api.v2 import attributes
from neutron.services.loadbalancer.drivers import abstract_driver
from neutron.services.loadbalancer.drivers.radware import exceptions as r_exc
-eventlet.monkey_patch(thread=True)
-
LOG = logging.getLogger(__name__)
RESP_STATUS = 0
import time
import eventlet
+eventlet.monkey_patch()
+
from oslo.config import cfg
from neutron.agent.common import config
def main():
- eventlet.monkey_patch()
conf = cfg.CONF
conf.register_opts(MeteringAgent.Opts)
config.register_agent_state_opts_helper(conf)
with mock.patch.object(hyperv_neutron_agent,
'HyperVNeutronAgent') as plugin:
with mock.patch.object(hyperv_neutron_agent.cfg, 'CONF') as cfg:
- with mock.patch('eventlet.monkey_patch') as eventlet:
- with mock.patch.object(
- hyperv_neutron_agent,
- 'logging_config') as logging_config:
+ with mock.patch.object(
+ hyperv_neutron_agent,
+ 'logging_config') as logging_config:
- hyperv_neutron_agent.main()
+ hyperv_neutron_agent.main()
- self.assertTrue(cfg.called)
- self.assertTrue(eventlet.called)
- self.assertTrue(logging_config.setup_logging.called)
- plugin.assert_has_calls([mock.call().daemon_loop()])
+ self.assertTrue(cfg.called)
+ self.assertTrue(logging_config.setup_logging.called)
+ plugin.assert_has_calls([mock.call().daemon_loop()])
def test_main(self):
with contextlib.nested(
mock.patch.object(nec_neutron_agent, 'NECNeutronAgent'),
- mock.patch('eventlet.monkey_patch'),
mock.patch.object(nec_neutron_agent, 'logging_config'),
mock.patch.object(nec_neutron_agent, 'config')
- ) as (agent, eventlet, logging_config, cfg):
+ ) as (agent, logging_config, cfg):
cfg.OVS.integration_bridge = 'br-int-x'
cfg.AGENT.root_helper = 'dummy-helper'
cfg.AGENT.polling_interval = 10
nec_neutron_agent.main()
- self.assertTrue(eventlet.called)
self.assertTrue(logging_config.setup_logging.called)
agent.assert_has_calls([
mock.call('br-int-x', 'dummy-helper', 10),
def test_main(self):
with contextlib.nested(
mock.patch.object(nvsd_neutron_agent, 'NVSDNeutronAgent'),
- mock.patch('eventlet.monkey_patch'),
mock.patch.object(nvsd_neutron_agent, 'logging_config'),
mock.patch.object(nvsd_neutron_agent, 'config')
- ) as (agent, eventlet, logging_config, config):
+ ) as (agent, logging_config, config):
config.AGENT.integration_bridge = 'br-int-dummy'
config.AGENT.root_helper = 'root-helper'
config.AGENT.polling_interval = 5
nvsd_neutron_agent.main()
- self.assertTrue(eventlet.called)
self.assertTrue(logging_config.setup_logging.called)
agent.assert_has_calls([
mock.call('br-int-dummy', 'root-helper', 5),
with contextlib.nested(
mock.patch(logging_str),
mock.patch.object(agent.service, 'launch'),
- mock.patch.object(agent, 'eventlet'),
mock.patch('sys.argv'),
mock.patch.object(agent.manager, 'LbaasAgentManager'),
mock.patch.object(cfg.CONF, 'register_opts')
- ) as (mock_logging, mock_launch, mock_eventlet, sys_argv, mgr_cls, ro):
+ ) as (mock_logging, mock_launch, sys_argv, mgr_cls, ro):
agent.main()
- self.assertTrue(mock_eventlet.monkey_patch.called)
mock_launch.assert_called_once_with(mock.ANY)
def test_main(self):
with mock.patch.object(agent, 'UnixDomainMetadataProxy') as proxy:
- with mock.patch('eventlet.monkey_patch') as eventlet:
- with mock.patch.object(agent, 'config') as config:
- with mock.patch.object(agent, 'cfg') as cfg:
- with mock.patch.object(utils, 'cfg'):
- agent.main()
-
- self.assertTrue(eventlet.called)
- self.assertTrue(config.setup_logging.called)
- proxy.assert_has_calls([
- mock.call(cfg.CONF),
- mock.call().run()]
- )
+ with mock.patch.object(agent, 'config') as config:
+ with mock.patch.object(agent, 'cfg') as cfg:
+ with mock.patch.object(utils, 'cfg'):
+ agent.main()
+
+ self.assertTrue(config.setup_logging.called)
+ proxy.assert_has_calls([
+ mock.call(cfg.CONF),
+ mock.call().run()]
+ )
def test_init_state_reporting(self):
with mock.patch('os.makedirs'):
def test_main(self):
with mock.patch.object(ns_proxy, 'ProxyDaemon') as daemon:
- with mock.patch('eventlet.monkey_patch') as eventlet:
- with mock.patch.object(ns_proxy, 'config') as config:
- with mock.patch.object(ns_proxy, 'cfg') as cfg:
- with mock.patch.object(utils, 'cfg') as utils_cfg:
- cfg.CONF.router_id = 'router_id'
- cfg.CONF.network_id = None
- cfg.CONF.metadata_port = 9697
- cfg.CONF.pid_file = 'pidfile'
- cfg.CONF.daemonize = True
- utils_cfg.CONF.log_opt_values.return_value = None
- ns_proxy.main()
-
- self.assertTrue(eventlet.called)
- self.assertTrue(config.setup_logging.called)
- daemon.assert_has_calls([
- mock.call('pidfile', 9697,
- router_id='router_id',
- network_id=None),
- mock.call().start()]
- )
+ with mock.patch.object(ns_proxy, 'config') as config:
+ with mock.patch.object(ns_proxy, 'cfg') as cfg:
+ with mock.patch.object(utils, 'cfg') as utils_cfg:
+ cfg.CONF.router_id = 'router_id'
+ cfg.CONF.network_id = None
+ cfg.CONF.metadata_port = 9697
+ cfg.CONF.pid_file = 'pidfile'
+ cfg.CONF.daemonize = True
+ utils_cfg.CONF.log_opt_values.return_value = None
+ ns_proxy.main()
+
+ self.assertTrue(config.setup_logging.called)
+ daemon.assert_has_calls([
+ mock.call('pidfile', 9697,
+ router_id='router_id',
+ network_id=None),
+ mock.call().start()]
+ )
def test_main_dont_fork(self):
with mock.patch.object(ns_proxy, 'ProxyDaemon') as daemon:
- with mock.patch('eventlet.monkey_patch') as eventlet:
- with mock.patch.object(ns_proxy, 'config') as config:
- with mock.patch.object(ns_proxy, 'cfg') as cfg:
- with mock.patch.object(utils, 'cfg') as utils_cfg:
- cfg.CONF.router_id = 'router_id'
- cfg.CONF.network_id = None
- cfg.CONF.metadata_port = 9697
- cfg.CONF.pid_file = 'pidfile'
- cfg.CONF.daemonize = False
- utils_cfg.CONF.log_opt_values.return_value = None
- ns_proxy.main()
-
- self.assertTrue(eventlet.called)
- self.assertTrue(config.setup_logging.called)
- daemon.assert_has_calls([
- mock.call('pidfile', 9697,
- router_id='router_id',
- network_id=None),
- mock.call().run()]
- )
+ with mock.patch.object(ns_proxy, 'config') as config:
+ with mock.patch.object(ns_proxy, 'cfg') as cfg:
+ with mock.patch.object(utils, 'cfg') as utils_cfg:
+ cfg.CONF.router_id = 'router_id'
+ cfg.CONF.network_id = None
+ cfg.CONF.metadata_port = 9697
+ cfg.CONF.pid_file = 'pidfile'
+ cfg.CONF.daemonize = False
+ utils_cfg.CONF.log_opt_values.return_value = None
+ ns_proxy.main()
+
+ self.assertTrue(config.setup_logging.called)
+ daemon.assert_has_calls([
+ mock.call('pidfile', 9697,
+ router_id='router_id',
+ network_id=None),
+ mock.call().run()]
+ )
from xml.parsers import expat
import eventlet.wsgi
-eventlet.patcher.monkey_patch(all=False, socket=True)
+eventlet.patcher.monkey_patch(all=False, socket=True, thread=True)
from oslo.config import cfg
import routes.middleware
import webob.dec