From 056df827ff3f8d40eeeedea3d09daae86982e5b5 Mon Sep 17 00:00:00 2001
From: Jason Dillaman <dillaman@redhat.com>
Date: Mon, 1 Jul 2013 08:52:13 -0400
Subject: [PATCH] Set QPID_HOST parameter to better support multi-node mode

When deploying OpenStack in a multi-node configuration,
the Qpid clients need the hostname of the potentially
remote Qpid server in order to permit the necessary RPC
communication between components.

Fixes bug #1196521

Change-Id: Iee3c3747cedea9488ec345e78f8eddbc6e850573
---
 lib/rpc_backend | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/rpc_backend b/lib/rpc_backend
index 4b04053bac..462e6cc913 100644
--- a/lib/rpc_backend
+++ b/lib/rpc_backend
@@ -170,8 +170,9 @@ function iniset_rpc_backend() {
         # Set MATCHMAKER_REDIS_HOST if running multi-node.
         MATCHMAKER_REDIS_HOST=${MATCHMAKER_REDIS_HOST:-127.0.0.1}
         iniset $file matchmaker_redis host $MATCHMAKER_REDIS_HOST
-    elif is_service_enabled qpid; then
+    elif is_service_enabled qpid || [ -n "$QPID_HOST" ]; then
         iniset $file $section rpc_backend ${package}.openstack.common.rpc.impl_qpid
+        iniset $file $section qpid_hostname $QPID_HOST
         if is_ubuntu; then
             QPID_PASSWORD=`sudo strings /etc/qpid/qpidd.sasldb | grep -B1 admin | head -1`
             iniset $file $section qpid_password $QPID_PASSWORD