Skip to content

Commit 5be53ea

Browse files
committed
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
1 parent bb2d4ac commit 5be53ea

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

neutron/plugins/ofagent/agent/main.py

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Copyright (C) 2014 VA Linux Systems Japan K.K.
2+
# All Rights Reserved.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
5+
# not use this file except in compliance with the License. You may obtain
6+
# a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
# License for the specific language governing permissions and limitations
14+
# under the License.
15+
#
16+
# @author: Fumihiko Kakuma, VA Linux Systems Japan K.K.
17+
# @author: YAMAMOTO Takashi, VA Linux Systems Japan K.K.
18+
19+
from ryu.lib import hub
20+
hub.patch()
21+
22+
import sys
23+
24+
from oslo.config import cfg
25+
from ryu.base.app_manager import AppManager
26+
from ryu import cfg as ryu_cfg
27+
28+
from neutron.common import config as common_config
29+
30+
31+
def main():
32+
common_config.init(sys.argv[1:])
33+
# the following check is a transitional workaround to make this work
34+
# with different versions of ryu.
35+
# TODO(yamamoto) remove this later
36+
if ryu_cfg.CONF is not cfg.CONF:
37+
ryu_cfg.CONF(project='ryu', args=[])
38+
common_config.setup_logging(cfg.CONF)
39+
AppManager.run_apps(['neutron.plugins.ofagent.agent.ofa_neutron_agent'])

setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ console_scripts =
115115
neutron-usage-audit = neutron.cmd.usage_audit:main
116116
neutron-vpn-agent = neutron.services.vpn.agent:main
117117
neutron-metering-agent = neutron.services.metering.agents.metering_agent:main
118-
neutron-ofagent-agent = ryu.cmd.ofa_neutron_agent:main
118+
neutron-ofagent-agent = neutron.plugins.ofagent.agent.main:main
119119
neutron-sanity-check = neutron.cmd.sanity_check:main
120120
neutron.core_plugins =
121121
bigswitch = neutron.plugins.bigswitch.plugin:NeutronRestProxyV2

0 commit comments

Comments
 (0)