From: fujinhua Date: Fri, 3 Aug 2018 03:31:06 +0000 (+0800) Subject: Fix log directory problem when exec UT X-Git-Tag: 1.2.0~13 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=23a8a64568e4793b97eb633bd5b54f1539a90f0c;p=vfc%2Fgvnfm%2Fvnfres.git Fix log directory problem when exec UT Change log directory when exec UT Change-Id: I7ad9d18afcfc1991ac6ef7ffb119696b82640b49 Issue-ID: VFC-1010 Signed-off-by: fujinhua --- diff --git a/res/res/settings.py b/res/res/settings.py index f15deff..ceda0e4 100644 --- a/res/res/settings.py +++ b/res/res/settings.py @@ -155,10 +155,14 @@ STATIC_URL = '/static/' LOGGING_CONFIG = None # yaml configuration of logging LOGGING_FILE = os.path.join(BASE_DIR, 'res/log.yml') +if 'test' in sys.argv: + os.system('sed -i "s|/var/log/onap/vfc/gvnfm-vnfres|/tmp|" %s' % LOGGING_FILE) config.yamlConfig(filepath=LOGGING_FILE, watchDog=True) if 'test' in sys.argv: + os.system('sed -i "s|/tmp|/var/log/onap/vfc/gvnfm-vnfres|" %s' % LOGGING_FILE) + from res.pub.config import config config.REG_TO_MSB_WHEN_START = False DATABASES = {}