]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
ofagent: move main module from ryu repository
authorYAMAMOTO Takashi <yamamoto@valinux.co.jp>
Fri, 20 Jun 2014 03:08:18 +0000 (12:08 +0900)
committerYAMAMOTO Takashi <yamamoto@valinux.co.jp>
Mon, 23 Jun 2014 11:22:22 +0000 (20:22 +0900)
the recent oslo.messaging transition broke ofagent.
this commit fixes the regression.

historically the main module of ofagent has been maintained
in ryu's repository.  this commit moves it into neutron's
repository and add common_config.init() call which is necesary
for the new rpc code.

Closes-Bug: #1332478
Change-Id: Icf215b20cd84ef44b51439e55b1815d72041ba3f

neutron/plugins/ofagent/agent/main.py [new file with mode: 0755]
setup.cfg

diff --git a/neutron/plugins/ofagent/agent/main.py b/neutron/plugins/ofagent/agent/main.py
new file mode 100755 (executable)
index 0000000..df000f0
--- /dev/null
@@ -0,0 +1,39 @@
+# Copyright (C) 2014 VA Linux Systems Japan K.K.
+# All Rights Reserved.
+#
+#    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.
+#
+# @author: Fumihiko Kakuma, VA Linux Systems Japan K.K.
+# @author: YAMAMOTO Takashi, VA Linux Systems Japan K.K.
+
+from ryu.lib import hub
+hub.patch()
+
+import sys
+
+from oslo.config import cfg
+from ryu.base.app_manager import AppManager
+from ryu import cfg as ryu_cfg
+
+from neutron.common import config as common_config
+
+
+def main():
+    common_config.init(sys.argv[1:])
+    # the following check is a transitional workaround to make this work
+    # with different versions of ryu.
+    # TODO(yamamoto) remove this later
+    if ryu_cfg.CONF is not cfg.CONF:
+        ryu_cfg.CONF(project='ryu', args=[])
+    common_config.setup_logging(cfg.CONF)
+    AppManager.run_apps(['neutron.plugins.ofagent.agent.ofa_neutron_agent'])
index 0eaaaed0f668c1ac7ed886fe750b60e7b76e44b2..94f7d9cd7bed1dee165c560acdb7e2ddd6785c3f 100644 (file)
--- a/setup.cfg
+++ b/setup.cfg
@@ -115,7 +115,7 @@ console_scripts =
     neutron-usage-audit = neutron.cmd.usage_audit:main
     neutron-vpn-agent = neutron.services.vpn.agent:main
     neutron-metering-agent = neutron.services.metering.agents.metering_agent:main
-    neutron-ofagent-agent = ryu.cmd.ofa_neutron_agent:main
+    neutron-ofagent-agent = neutron.plugins.ofagent.agent.main:main
     neutron-sanity-check = neutron.cmd.sanity_check:main
 neutron.core_plugins =
     bigswitch = neutron.plugins.bigswitch.plugin:NeutronRestProxyV2