Closed llvtt closed 10 years ago
Looks OK to me, assuming @gjmurakami-10gen is happy.
In server.py, if MONGO_ORCHESTRATION_HOME is not set, can we set it to work_dir, so that we can always look up the configurations via a full path and not be affected by any chdir?
@gjmurakami-10gen
MONGO_ORCHESTRATION_HOME
is now set to work_dir
on startup, if unset.
The above plus the following works for me. An alternative would be a global workdir, we'd probably need to have an appropriate global for tests which don't use server.py.
diff --git a/server.py b/server.py index de7dcd4..c2a9e39 100644 --- a/server.py +++ b/server.py @@ -15,6 +15,9 @@ work_dir = os.path.split(os.path.join(os.getcwd(), file))[0] pid_file = os.path.join(work_dir, 'server.pid') log_file = os.path.join(work_dir, 'server.log')
+if not os.environ.get("MONGO_ORCHESTRATION_HOME"):
os.environ["MONGO_ORCHESTRATION_HOME"] = work_dir + DEFAULT_PORT = 8889
import logging
LGTM
merged manually in a5eb4876921e21c0cfee14f3d02b9fa2fb21129a and 126a0e79cc2d5a9e7422a05e7b3037dfa64f12b6 due to merge conflicts.
Addresses #83.
Changes:
MONGO_ORCHESTRATION_HOME
environment variable can inform Mongo Orchestration where to find the "configurations" directory. This also allows users to start the server with--no-fork
from outside of the project root and still use the presets.