Allowed multiple versions of MongoDB

This commit is contained in:
Michael Schmatz 2014-02-05 08:53:04 -08:00
parent 32bae5362e
commit 63b5b50f96

View file

@ -69,8 +69,10 @@ def which(cmd, mode=os.F_OK | os.X_OK, path=None):
#TODO: Upgrade this so it works on windows
#These scripts will be placed in coco/bin
current_directory = os.path.dirname(os.path.realpath(sys.argv[0]))
if which("mongod") and "v2.5.4" in subprocess.check_output("mongod --version",shell=True):
allowedMongoVersions = ["v2.5.4","v2.5.5"]
if which("mongod") and any(i in subprocess.check_output("mongod --version",shell=True) for i in allowedMongoVersions):
mongo_executable = "mongod"
else:
mongo_executable = None