Explicitly monkey patch VPN agent

Don't rely on l3_agent entry point in neutron to do it for the agent.

There are plans [1] to move eventlet monkey patching into a separate
location other than neutron.agent.l3_agent. That means we won't be able
to rely on base l3_agent module to be monkey patched for us.

This patch mimics the tree structure used in neutron to keep eventlet
patched services in single place. Even though there is only one agent in
tree that needs monkey patching, it's better to keep things uniformly
with neutron, and allow to introduce more agents later without
explicitly adding another call to monkey_patch() for those.

[1]: I2bc16ca4422c01d64e9fac4910214dbb0d0326ff

Change-Id: I2d7081dbd4cb532332e3b66667bb8c71aa5a6658
This commit is contained in:
Ihar Hrachyshka 2015-02-17 15:23:04 +01:00
parent 3e0d5e41b1
commit e6c88f5602
4 changed files with 32 additions and 1 deletions

View File

View File

@ -0,0 +1,14 @@
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import eventlet
eventlet.monkey_patch()

View File

@ -0,0 +1,17 @@
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from neutron_vpnaas.services.vpn import agent
def main():
agent.main()

View File

@ -34,7 +34,7 @@ setup-hooks =
[entry_points]
console_scripts =
neutron-vpn-netns-wrapper = neutron_vpnaas.services.vpn.common.netns_wrapper:main
neutron-vpn-agent = neutron_vpnaas.services.vpn.agent:main
neutron-vpn-agent = neutron_vpnaas.cmd.eventlet.agent:main
device_drivers =
neutron.services.vpn.device_drivers.ipsec.OpenSwanDriver = neutron_vpnaas.services.vpn.device_drivers.ipsec:OpenSwanDriver
neutron.services.vpn.device_drivers.cisco_ipsec.CiscoCsrIPsecDriver = neutron_vpnaas.services.vpn.device_drivers.cisco_ipsec:CiscoCsrIPsecDriver