From b3e8d6302f642ed5e328936303a84d8e21b2765f Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Fri, 9 Mar 2012 14:03:39 -0500 Subject: [PATCH] look for the config files relative to where the program lives, not where the user is running it --- devstack/settings.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/devstack/settings.py b/devstack/settings.py index 3aaf390f..2e644ad2 100644 --- a/devstack/settings.py +++ b/devstack/settings.py @@ -16,6 +16,7 @@ import os import re +import sys # These also have meaning outside python, # ie in the pkg/pip listings so update there also! @@ -122,7 +123,8 @@ STOP = "stop" ACTIONS = [INSTALL, UNINSTALL, START, STOP] # Where the configs and templates should be at. -STACK_CONFIG_DIR = os.path.join(os.getcwd(), "conf") +STACK_BIN_DIR = os.path.abspath(os.path.dirname(sys.argv[0])) +STACK_CONFIG_DIR = os.path.join(STACK_BIN_DIR, "conf") STACK_TEMPLATE_DIR = os.path.join(STACK_CONFIG_DIR, "templates") STACK_PKG_DIR = os.path.join(STACK_CONFIG_DIR, "pkgs") STACK_PIP_DIR = os.path.join(STACK_CONFIG_DIR, "pips")