]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Moved several services into neutron.cmd.eventlet
authorIhar Hrachyshka <ihrachys@redhat.com>
Wed, 18 Feb 2015 11:11:07 +0000 (12:11 +0100)
committerIhar Hrachyshka <ihrachys@redhat.com>
Wed, 18 Feb 2015 12:33:57 +0000 (13:33 +0100)
- dhcp-agent
- l3-agent
- metadata-agent
- metadata-proxy
- metering-agent
- server

This allows us to remove explicit monkey_patch() call.

Also removed ability to execute neutron-server avoiding a corresponding
entry point.

Depends-On: I2d7081dbd4cb532332e3b66667bb8c71aa5a6658

Related-Bug: #1418541
Change-Id: I89e3e8e23374ab1a9a1844b3caaa88e162418546

15 files changed:
neutron/agent/dhcp_agent.py
neutron/agent/l3_agent.py
neutron/agent/metadata/namespace_proxy.py
neutron/agent/metadata_agent.py
neutron/cmd/eventlet/agents/__init__.py [new file with mode: 0644]
neutron/cmd/eventlet/agents/dhcp.py [new file with mode: 0644]
neutron/cmd/eventlet/agents/l3.py [new file with mode: 0644]
neutron/cmd/eventlet/agents/metadata.py [new file with mode: 0644]
neutron/cmd/eventlet/agents/metadata_proxy.py [new file with mode: 0644]
neutron/cmd/eventlet/server/__init__.py [new file with mode: 0644]
neutron/cmd/eventlet/services/__init__.py [new file with mode: 0644]
neutron/cmd/eventlet/services/metering_agent.py [new file with mode: 0644]
neutron/server/__init__.py
neutron/services/metering/agents/metering_agent.py
setup.cfg

index 0e756451106eeca0b4f70b70b7efa2b1e696a964..c6cc7ad600cad5a4349b4232b852e6d9f49f0205 100644 (file)
@@ -16,9 +16,6 @@
 
 import sys
 
-import eventlet
-eventlet.monkey_patch()
-
 from oslo_config import cfg
 
 from neutron.agent.common import config
index 8a8f31904868270fb6c27467fa49a2198de652f7..665f6b4558361c7703e85e1669298b0dac037f2a 100644 (file)
@@ -16,9 +16,6 @@
 
 import sys
 
-import eventlet
-eventlet.monkey_patch()
-
 from oslo_config import cfg
 
 from neutron.agent.common import config
index 05b34ba65056bcc82beb6bc6854628ddff86709a..3bf465acbaa8b55828d4bd040cf4e99aff2a0ea0 100644 (file)
@@ -15,9 +15,6 @@
 import httplib
 import socket
 
-import eventlet
-eventlet.monkey_patch()
-
 import httplib2
 from oslo_config import cfg
 import six.moves.urllib.parse as urlparse
index 407b157b3b9fab27a47f5bd5128fe2aaf49051b1..a6cec3a28ee106fef8a389491620318aacf792f5 100644 (file)
@@ -14,9 +14,6 @@
 
 import sys
 
-import eventlet
-eventlet.monkey_patch()
-
 from oslo_config import cfg
 
 from neutron.agent.common import config as agent_conf
diff --git a/neutron/cmd/eventlet/agents/__init__.py b/neutron/cmd/eventlet/agents/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/neutron/cmd/eventlet/agents/dhcp.py b/neutron/cmd/eventlet/agents/dhcp.py
new file mode 100644 (file)
index 0000000..f1c04cf
--- /dev/null
@@ -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.agent import dhcp_agent
+
+
+def main():
+    dhcp_agent.main()
diff --git a/neutron/cmd/eventlet/agents/l3.py b/neutron/cmd/eventlet/agents/l3.py
new file mode 100644 (file)
index 0000000..e44acd5
--- /dev/null
@@ -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.agent import l3_agent
+
+
+def main():
+    l3_agent.main()
diff --git a/neutron/cmd/eventlet/agents/metadata.py b/neutron/cmd/eventlet/agents/metadata.py
new file mode 100644 (file)
index 0000000..17ad50a
--- /dev/null
@@ -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.agent import metadata_agent
+
+
+def main():
+    metadata_agent.main()
diff --git a/neutron/cmd/eventlet/agents/metadata_proxy.py b/neutron/cmd/eventlet/agents/metadata_proxy.py
new file mode 100644 (file)
index 0000000..dc61c14
--- /dev/null
@@ -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.agent.metadata import namespace_proxy
+
+
+def main():
+    namespace_proxy.main()
diff --git a/neutron/cmd/eventlet/server/__init__.py b/neutron/cmd/eventlet/server/__init__.py
new file mode 100644 (file)
index 0000000..bfa2568
--- /dev/null
@@ -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 import server
+
+
+def main():
+    server.main()
diff --git a/neutron/cmd/eventlet/services/__init__.py b/neutron/cmd/eventlet/services/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/neutron/cmd/eventlet/services/metering_agent.py b/neutron/cmd/eventlet/services/metering_agent.py
new file mode 100644 (file)
index 0000000..b5f9b3f
--- /dev/null
@@ -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.services.metering.agents import metering_agent
+
+
+def main():
+    metering_agent.main()
index 81f430310c18c62af13e8c7e3113f59f2003338b..8f286fbdb6223ec0068daec1fe3a3216f0038786 100755 (executable)
@@ -21,8 +21,6 @@
 import sys
 
 import eventlet
-eventlet.monkey_patch()
-
 from oslo_config import cfg
 
 from neutron.common import config
@@ -63,7 +61,3 @@ def main():
         pass
     except RuntimeError as e:
         sys.exit(_("ERROR: %s") % e)
-
-
-if __name__ == "__main__":
-    main()
index c24606211b69c8e902d059ce988899e5022b4cab..5dcc56493beea17f44f8baf687434891b1375170 100644 (file)
@@ -15,9 +15,6 @@
 import sys
 import time
 
-import eventlet
-eventlet.monkey_patch()
-
 from oslo_config import cfg
 import oslo_messaging
 from oslo_utils import importutils
index 0a60ec4ee06662035c515fac9d55934b78843aa4..6cb1a5d46195744fc8d3581b63f77e300e8b9990 100644 (file)
--- a/setup.cfg
+++ b/setup.cfg
@@ -94,25 +94,25 @@ console_scripts =
     neutron-check-nsx-config = neutron.plugins.vmware.check_nsx_config:main
     neutron-db-manage = neutron.db.migration.cli:main
     neutron-debug = neutron.debug.shell:main
-    neutron-dhcp-agent = neutron.agent.dhcp_agent:main
+    neutron-dhcp-agent = neutron.cmd.eventlet.agents.dhcp:main
     neutron-hyperv-agent = neutron.plugins.hyperv.agent.hyperv_neutron_agent:main
     neutron-ibm-agent = neutron.plugins.ibm.agent.sdnve_neutron_agent:main
-    neutron-l3-agent = neutron.agent.l3_agent:main
+    neutron-l3-agent = neutron.cmd.eventlet.agents.l3:main
     neutron-linuxbridge-agent = neutron.plugins.linuxbridge.agent.linuxbridge_neutron_agent:main
-    neutron-metadata-agent = neutron.agent.metadata_agent:main
+    neutron-metadata-agent = neutron.cmd.eventlet.agents.metadata:main
     neutron-mlnx-agent = neutron.plugins.mlnx.agent.eswitch_neutron_agent:main
     neutron-nec-agent = neutron.plugins.nec.agent.nec_neutron_agent:main
     neutron-netns-cleanup = neutron.cmd.netns_cleanup:main
-    neutron-ns-metadata-proxy = neutron.agent.metadata.namespace_proxy:main
+    neutron-ns-metadata-proxy = neutron.cmd.eventlet.agents.metadata_proxy:main
     neutron-nsx-manage = neutron.plugins.vmware.shell:main
     neutron-nvsd-agent = neutron.plugins.oneconvergence.agent.nvsd_neutron_agent:main
     neutron-openvswitch-agent = neutron.plugins.openvswitch.agent.ovs_neutron_agent:main
     neutron-ovs-cleanup = neutron.cmd.ovs_cleanup:main
     neutron-restproxy-agent = neutron.plugins.bigswitch.agent.restproxy_agent:main
-    neutron-server = neutron.server:main
+    neutron-server = neutron.cmd.eventlet.server:main
     neutron-rootwrap = oslo_rootwrap.cmd:main
     neutron-usage-audit = neutron.cmd.usage_audit:main
-    neutron-metering-agent = neutron.services.metering.agents.metering_agent:main
+    neutron-metering-agent = neutron.cmd.eventlet.services.metering_agent:main
     neutron-ofagent-agent = neutron.plugins.ofagent.agent.main:main
     neutron-sriov-nic-agent = neutron.plugins.sriovnicagent.sriov_nic_agent:main
     neutron-sanity-check = neutron.cmd.sanity_check:main