|
| 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']) |
0 commit comments