Fix log directory problem when exec UT 27/58827/1
authorfujinhua <fu.jinhua@zte.com.cn>
Fri, 3 Aug 2018 03:31:06 +0000 (11:31 +0800)
committerfujinhua <fu.jinhua@zte.com.cn>
Fri, 3 Aug 2018 03:31:06 +0000 (11:31 +0800)
Change log directory when exec UT

Change-Id: I7ad9d18afcfc1991ac6ef7ffb119696b82640b49
Issue-ID: VFC-1010
Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
res/res/settings.py

index f15deff..ceda0e4 100644 (file)
@@ -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 = {}