Browse Source

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
changes/66/101466/3
YAMAMOTO Takashi 8 years ago
parent
commit
5be53ea9fe
  1. 39
      neutron/plugins/ofagent/agent/main.py
  2. 2
      setup.cfg

39
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'])

2
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

Loading…
Cancel
Save