From 2cef6fbd4490fa169ab92599f9df866d0fbaa888 Mon Sep 17 00:00:00 2001 From: Isaku Yamahata Date: Tue, 12 Feb 2013 23:05:40 +0900 Subject: [PATCH] ryu: minor updates for Ryu upstream change Since Ryu upstream changed configuration format, which is user visible. Plus minor updates. Fixes bug #1132992 Change-Id: I531360f3e0470916144d2c409066f1a8c75ec26f Signed-off-by: Isaku Yamahata --- lib/quantum_plugins/ryu | 2 ++ lib/quantum_thirdparty/ryu | 40 ++++++++++++++++++++++---------------- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/lib/quantum_plugins/ryu b/lib/quantum_plugins/ryu index 2dfd4f705a..d1d7382c4b 100644 --- a/lib/quantum_plugins/ryu +++ b/lib/quantum_plugins/ryu @@ -17,7 +17,9 @@ function quantum_plugin_install_agent_packages() { _quantum_ovs_base_install_agent_packages # quantum_ryu_agent requires ryu module + install_package $(get_packages "ryu") install_ryu + configure_ryu } function quantum_plugin_configure_common() { diff --git a/lib/quantum_thirdparty/ryu b/lib/quantum_thirdparty/ryu index 7a01923cbf..f1e9e7c495 100644 --- a/lib/quantum_thirdparty/ryu +++ b/lib/quantum_thirdparty/ryu @@ -17,24 +17,15 @@ RYU_OFP_HOST=${RYU_OFP_HOST:-127.0.0.1} RYU_OFP_PORT=${RYU_OFP_PORT:-6633} # Ryu Applications RYU_APPS=${RYU_APPS:-ryu.app.simple_isolation,ryu.app.rest} -# Ryu configuration -RYU_CONF_CONTENTS=${RYU_CONF_CONTENTS:-" ---app_lists=$RYU_APPS ---wsapi_host=$RYU_API_HOST ---wsapi_port=$RYU_API_PORT ---ofp_listen_host=$RYU_OFP_HOST ---ofp_tcp_listen_port=$RYU_OFP_PORT ---quantum_url=http://$Q_HOST:$Q_PORT ---quantum_admin_username=$Q_ADMIN_USERNAME ---quantum_admin_password=$SERVICE_PASSWORD ---quantum_admin_tenant_name=$SERVICE_TENANT_NAME ---quantum_admin_auth_url=$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_AUTH_PORT/v2.0 ---quantum_auth_strategy=$Q_AUTH_STRATEGY ---quantum_controller_addr=tcp:$RYU_OFP_HOST:$RYU_OFP_PORT -"} +# configure_ryu can be called multiple times as quantum_pluing/ryu may call +# this function for quantum-ryu-agent +_RYU_CONFIGURED=${_RYU_CONFIGURED:-False} function configure_ryu() { - setup_develop $RYU_DIR + if [[ "$_RYU_CONFIGURED" == "False" ]]; then + setup_develop $RYU_DIR + _RYU_CONFIGURED=True + fi } function init_ryu() { @@ -46,6 +37,21 @@ function init_ryu() { RYU_CONF=$RYU_CONF_DIR/ryu.conf sudo rm -rf $RYU_CONF + # Ryu configuration + RYU_CONF_CONTENTS=${RYU_CONF_CONTENTS:-"[DEFAULT] +app_lists=$RYU_APPS +wsapi_host=$RYU_API_HOST +wsapi_port=$RYU_API_PORT +ofp_listen_host=$RYU_OFP_HOST +ofp_tcp_listen_port=$RYU_OFP_PORT +quantum_url=http://$Q_HOST:$Q_PORT +quantum_admin_username=$Q_ADMIN_USERNAME +quantum_admin_password=$SERVICE_PASSWORD +quantum_admin_tenant_name=$SERVICE_TENANT_NAME +quantum_admin_auth_url=$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_AUTH_PORT/v2.0 +quantum_auth_strategy=$Q_AUTH_STRATEGY +quantum_controller_addr=tcp:$RYU_OFP_HOST:$RYU_OFP_PORT +"} echo "${RYU_CONF_CONTENTS}" > $RYU_CONF } @@ -62,7 +68,7 @@ function install_ryu() { } function start_ryu() { - screen_it ryu "cd $RYU_DIR && $RYU_DIR/bin/ryu-manager --flagfile $RYU_CONF" + screen_it ryu "cd $RYU_DIR && $RYU_DIR/bin/ryu-manager --config-file $RYU_CONF" } function stop_ryu() {