From ec86891c8f6f768f0cf54674031669d1e4c8820d Mon Sep 17 00:00:00 2001
From: Matthew Heler <mh935s@att.com>
Date: Tue, 8 Jan 2019 03:00:52 -0600
Subject: [PATCH] [CEPH] select the RGW backend based on RGW version

Use the Beast backend only when Mimic binaries are installed.
Otherwise use civitweb if the binares are from Ceph Luminous.

Change-Id: Ia7cb64d8db7eed2fc0c57387b26a27163af34520
---
 ceph-rgw/templates/bin/rgw/_start.sh.tpl | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/ceph-rgw/templates/bin/rgw/_start.sh.tpl b/ceph-rgw/templates/bin/rgw/_start.sh.tpl
index 474c26019..cfff38d7f 100644
--- a/ceph-rgw/templates/bin/rgw/_start.sh.tpl
+++ b/ceph-rgw/templates/bin/rgw/_start.sh.tpl
@@ -54,7 +54,11 @@ if [ ! -e "${RGW_KEYRING}" ]; then
   chmod 0600 "${RGW_KEYRING}"
 fi
 
-RGW_FRONTENDS="beast port=${RGW_FRONTEND_PORT}"
+if [[ $(ceph -v | egrep -c "luminous" | xargs echo) -gt 0 ]]; then
+  RGW_FRONTENDS="civitweb port=${RGW_FRONTEND_PORT}"
+else
+  RGW_FRONTENDS="beast port=${RGW_FRONTEND_PORT}"
+fi
 
 /usr/bin/radosgw \
   --cluster "${CLUSTER}" \