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
diff --git a/lib/marconi b/lib/marconi
index 063ed3d..e05518c 100644
--- a/lib/marconi
+++ b/lib/marconi
@@ -42,7 +42,7 @@
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 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
}