summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfujinhua <fu.jinhua@zte.com.cn>2018-08-03 11:44:57 +0800
committerfujinhua <fu.jinhua@zte.com.cn>2018-08-03 11:44:57 +0800
commit44a210789ca4d5b71d7ffcbee94ef51116a89ad8 (patch)
tree8282d5f28f2f8d8613a6cdce2e85a54e6c46cc2b
parente22848c217e09f18324cece68f5e74f7652f0a0e (diff)
Fix log directory problem when exec UT
Change log directory when exec UT Change-Id: I2659bbd703ba0eed78ca5d2a8084377db608873f Issue-ID: VFC-1010 Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
-rw-r--r--gvnfmadapter/driver/settings.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/gvnfmadapter/driver/settings.py b/gvnfmadapter/driver/settings.py
index 0a43d3c..67aa7db 100644
--- a/gvnfmadapter/driver/settings.py
+++ b/gvnfmadapter/driver/settings.py
@@ -133,10 +133,14 @@ STATIC_URL = '/static/'
LOGGING_CONFIG = None
# yaml configuration of logging
LOGGING_FILE = os.path.join(BASE_DIR, 'driver/log.yml')
+if 'test' in sys.argv:
+ os.system('sed -i "s|/var/log/onap/vfc/gvnfmdriver|/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/gvnfmdriver|" %s' % LOGGING_FILE)
+
from driver.pub.config import config
config.REG_TO_MSB_WHEN_START = False