Signed-off-by: Isaku Yamahata <[email protected]>
---
bin/ryu-manager | 51 ++++-----------------------------------------------
1 file changed, 4 insertions(+), 47 deletions(-)
diff --git a/bin/ryu-manager b/bin/ryu-manager
index 62188de..7ea0193 100755
--- a/bin/ryu-manager
+++ b/bin/ryu-manager
@@ -16,31 +16,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from ryu.lib import hub
-hub.patch()
-
-# TODO:
-# Right now, we have our own patched copy of ovs python bindings
-# Once our modification is upstreamed and widely deployed,
-# use it
-#
-# NOTE: this modifies sys.path and thus affects the following imports.
-# eg. oslo.config.cfg.
-import ryu.contrib
+from ryu.base import main as ryu_main
+ryu_main.early_init()
from oslo.config import cfg
-import logging
-import sys
-
-from ryu import log
-log.early_init_log(logging.DEBUG)
-
-from ryu import flags
-from ryu import version
-from ryu.app import wsgi
-from ryu.base.app_manager import AppManager
-from ryu.controller import controller
-from ryu.topology import switches
CONF = cfg.CONF
@@ -53,33 +32,11 @@ CONF.register_cli_opts([
def main():
- CONF(project='ryu', version='ryu-manager %s' % version)
-
- log.init_log()
+ ryu_main.init()
# always enable ofp for now.
app_lists = CONF.app_lists + CONF.app + ['ryu.controller.ofp_handler']
-
- app_mgr = AppManager()
- app_mgr.load_apps(app_lists)
- contexts = app_mgr.create_contexts()
- app_mgr.instantiate_apps(**contexts)
-
- services = []
-
- ctlr = controller.OpenFlowController()
- thr = hub.spawn(ctlr)
- services.append(thr)
-
- webapp = wsgi.start_service(app_mgr)
- if webapp:
- thr = hub.spawn(webapp)
- services.append(thr)
-
- try:
- hub.joinall(services)
- finally:
- app_mgr.close()
+ ryu_main.main(app_lists, True)
if __name__ == "__main__":
--
1.7.10.4
------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel