From 429b39d8f854318f2d30d592b71526791f3fac9f Mon Sep 17 00:00:00 2001 From: Isaku Yamahata Date: Wed, 9 Jan 2013 18:35:55 +0900 Subject: [PATCH] Quantum/plugins/ryu: minor update for Quantum Ryu plugin - updated package list for Ryu ryu plugin/agent needs python-netifaces - quantum-ryu-agent also needs ryu module Change-Id: I5b49efceb65e8139a49a8e82f55ea6aa7d1eebac Signed-off-by: Isaku Yamahata --- files/apts/ryu | 1 + files/rpms/ryu | 1 + lib/quantum_plugins/ryu | 3 +++ lib/quantum_thirdparty/ryu | 10 +++++++++- 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/files/apts/ryu b/files/apts/ryu index 1e8f2d2ba9..4a4fc523b5 100644 --- a/files/apts/ryu +++ b/files/apts/ryu @@ -1,4 +1,5 @@ python-setuptools python-gevent python-gflags +python-netifaces python-sphinx diff --git a/files/rpms/ryu b/files/rpms/ryu index 1e8f2d2ba9..4a4fc523b5 100644 --- a/files/rpms/ryu +++ b/files/rpms/ryu @@ -1,4 +1,5 @@ python-setuptools python-gevent python-gflags +python-netifaces python-sphinx diff --git a/lib/quantum_plugins/ryu b/lib/quantum_plugins/ryu index 86105bc8b9..3f960ea815 100644 --- a/lib/quantum_plugins/ryu +++ b/lib/quantum_plugins/ryu @@ -15,6 +15,9 @@ function quantum_plugin_create_nova_conf() { function quantum_plugin_install_agent_packages() { _quantum_ovs_base_install_agent_packages + + # quantum_ryu_agent requires ryu module + install_ryu } function quantum_plugin_configure_common() { diff --git a/lib/quantum_thirdparty/ryu b/lib/quantum_thirdparty/ryu index f11951a3fa..5717d821c7 100644 --- a/lib/quantum_thirdparty/ryu +++ b/lib/quantum_thirdparty/ryu @@ -49,8 +49,16 @@ function init_ryu() { echo "${RYU_CONF_CONTENTS}" > $RYU_CONF } +# install_ryu can be called multiple times as quantum_pluing/ryu may call +# this function for quantum-ryu-agent +# Make this function idempotent and avoid cloning same repo many times +# with RECLONE=yes +_RYU_INSTALLED=${_RYU_INSTALLED:-False} function install_ryu() { - git_clone $RYU_REPO $RYU_DIR $RYU_BRANCH + if [[ "$_RYU_INSTALLED" == "False" ]]; then + git_clone $RYU_REPO $RYU_DIR $RYU_BRANCH + _RYU_INSTALLED=True + fi } function start_ryu() {