From 5be53ea9feb97a08b10442a33d755176507bc1f2 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Fri, 20 Jun 2014 12:08:18 +0900 Subject: [PATCH] ofagent: move main module from ryu repository 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 | 39 +++++++++++++++++++++++++++ setup.cfg | 2 +- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100755 neutron/plugins/ofagent/agent/main.py diff --git a/neutron/plugins/ofagent/agent/main.py b/neutron/plugins/ofagent/agent/main.py new file mode 100755 index 00000000000..df000f0511a --- /dev/null +++ b/neutron/plugins/ofagent/agent/main.py @@ -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']) diff --git a/setup.cfg b/setup.cfg index 0eaaaed0f66..94f7d9cd7be 100644 --- 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