Moved back to conf dir for templates. Made settings have the log file location + env var name.

This commit is contained in:
Joshua Harlow 2012-02-13 10:34:19 -08:00
parent a042d6f550
commit f45bc052d8
21 changed files with 10 additions and 6 deletions

View File

@ -106,11 +106,13 @@ STOP = "stop"
ACTIONS = [INSTALL, UNINSTALL, START, STOP] ACTIONS = [INSTALL, UNINSTALL, START, STOP]
# Where the configs and templates should be at. # Where the configs and templates should be at.
STACK_CONFIG_DIR = "conf" STACK_CONFIG_DIR = os.path.join(os.getcwd(), "conf")
STACK_TEMPLATE_DIR = "templates" STACK_TEMPLATE_DIR = os.path.join(STACK_CONFIG_DIR, "templates")
STACK_PKG_DIR = os.path.join(STACK_CONFIG_DIR, "pkgs") STACK_PKG_DIR = os.path.join(STACK_CONFIG_DIR, "pkgs")
STACK_PIP_DIR = os.path.join(STACK_CONFIG_DIR, "pips") STACK_PIP_DIR = os.path.join(STACK_CONFIG_DIR, "pips")
STACK_CONFIG_LOCATION = os.path.join(STACK_CONFIG_DIR, "stack.ini") STACK_CONFIG_LOCATION = os.path.join(STACK_CONFIG_DIR, "stack.ini")
STACK_LOG_CFG_LOCATION = os.path.join(STACK_CONFIG_DIR, "logging.ini")
STACK_LOG_ENV_LOCATION = 'LOG_FILE'
# These regex is how we match python platform output to a known constant # These regex is how we match python platform output to a known constant
KNOWN_DISTROS = { KNOWN_DISTROS = {

View File

@ -14,13 +14,13 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import fileinput
import getpass import getpass
import grp import grp
import os.path import os.path
import pwd import pwd
import shutil import shutil
import subprocess import subprocess
import fileinput
from devstack import env from devstack import env
from devstack import exceptions as excp from devstack import exceptions as excp

8
stack
View File

@ -21,10 +21,12 @@ import logging.config
import sys import sys
import traceback import traceback
from devstack import settings
#this needs to happen immediately (or thats what it seems) #this needs to happen immediately (or thats what it seems)
LOG_FN = os.getenv('LOG_FILE') LOG_FN = os.getenv(settings.STACK_LOG_ENV_LOCATION)
if(LOG_FN == None): if not LOG_FN or not os.path.isfile(LOG_FN):
LOG_FN = os.path.normpath(os.path.join("conf", 'logging.ini')) LOG_FN = settings.STACK_LOG_CFG_LOCATION
logging.config.fileConfig(LOG_FN) logging.config.fileConfig(LOG_FN)
from devstack import opts from devstack import opts