From d3ca1418c4f048be58080bd51c9497abe33d49b9 Mon Sep 17 00:00:00 2001 From: Li Ma Date: Sun, 21 Dec 2014 23:36:43 -0800 Subject: [PATCH] Fix matchmaker-redis dependencies for zeromq driver Add an option 'ZEROMQ_MATCHMAKER' to indicate which matchmaker driver to use. When it indicates 'redis', the dependencies will be installed. Change-Id: I910b48347bad0685ea10083a3b0b243524f32095 Partially-Implements: blueprint zeromq --- lib/rpc_backend | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/lib/rpc_backend b/lib/rpc_backend index 172d024f90..778d466963 100644 --- a/lib/rpc_backend +++ b/lib/rpc_backend @@ -87,11 +87,20 @@ function cleanup_rpc_backend { fi elif is_service_enabled zeromq; then if is_fedora; then - uninstall_package zeromq python-zmq redis + uninstall_package zeromq python-zmq + if [ "$ZEROMQ_MATCHMAKER" == "redis" ]; then + uninstall_package redis python-redis + fi elif is_ubuntu; then - uninstall_package libzmq1 python-zmq redis-server + uninstall_package libzmq1 python-zmq + if [ "$ZEROMQ_MATCHMAKER" == "redis" ]; then + uninstall_package redis-server python-redis + fi elif is_suse; then - uninstall_package libzmq1 python-pyzmq redis + uninstall_package libzmq1 python-pyzmq + if [ "$ZEROMQ_MATCHMAKER" == "redis" ]; then + uninstall_package redis python-redis + fi else exit_distro_not_supported "zeromq installation" fi @@ -150,11 +159,20 @@ function install_rpc_backend { # but there is a matchmaker driver that works # really well & out of the box for multi-node. if is_fedora; then - install_package zeromq python-zmq redis + install_package zeromq python-zmq + if [ "$ZEROMQ_MATCHMAKER" == "redis" ]; then + install_package redis python-redis + fi elif is_ubuntu; then - install_package libzmq1 python-zmq redis-server + install_package libzmq1 python-zmq + if [ "$ZEROMQ_MATCHMAKER" == "redis" ]; then + install_package redis-server python-redis + fi elif is_suse; then - install_package libzmq1 python-pyzmq redis + install_package libzmq1 python-pyzmq + if [ "$ZEROMQ_MATCHMAKER" == "redis" ]; then + install_package redis python-redis + fi else exit_distro_not_supported "zeromq installation" fi