From f7ae9ff5dd0f7e20037d49869251d2367b46c459 Mon Sep 17 00:00:00 2001 From: Malini Kamalambal Date: Thu, 26 Jun 2014 12:50:26 -0400 Subject: [PATCH] Use Mongo DB as the default backend With the gate upgrade to Trusty, Marconi should now be able to run with Mongo DB at the gate. Change-Id: I7bfe25d42c9429606ee209860685077806eb6756 --- lib/marconi | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/marconi b/lib/marconi index 063ed3d10c..e05518ce12 100644 --- a/lib/marconi +++ b/lib/marconi @@ -42,7 +42,7 @@ MARCONI_AUTH_CACHE_DIR=${MARCONI_AUTH_CACHE_DIR:-/var/cache/marconi} MARCONI_BIN_DIR=$(get_python_exec_prefix) # Set up database backend -MARCONI_BACKEND=${MARCONI_BACKEND:-sqlite} +MARCONI_BACKEND=${MARCONI_BACKEND:-mongodb} # Set Marconi repository @@ -77,6 +77,13 @@ function is_marconi_enabled { function cleanup_marconi { if ! timeout $SERVICE_TIMEOUT sh -c "while ! mongo marconi --eval 'db.dropDatabase();'; do sleep 1; done"; then die $LINENO "Mongo DB did not start" + else + full_version=$(mongo marconi --eval 'db.dropDatabase();') + mongo_version=`echo $full_version | cut -d' ' -f4` + required_mongo_version='2.2' + if [[ $mongo_version < $required_mongo_version ]]; then + die $LINENO "Marconi needs Mongo DB version >= 2.2 to run." + fi fi }