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