aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYujun Zhang <zhang.yujunz@zte.com.cn>2016-11-24 14:38:31 +0800
committerYujun Zhang <zhang.yujunz@zte.com.cn>2016-11-25 14:26:53 +0800
commit2ab673eea36d8df1947c17332686562f422fd14e (patch)
treea99b76e0c730f7b779b267e8b05f2e61b23182df
parent099238a0ea8f80b0765965ec306bf281c0c9dc55 (diff)
Fix exception caused by missing log folder
Change-Id: I3a73cc0366e2c1a9c5965367ea68138f36ff1d63 Signed-off-by: Yujun Zhang <zhang.yujunz@zte.com.cn>
-rw-r--r--qtip/utils/logger_utils.py3
-rw-r--r--tox.ini1
2 files changed, 4 insertions, 0 deletions
diff --git a/qtip/utils/logger_utils.py b/qtip/utils/logger_utils.py
index e8817c3c..d5e76a64 100644
--- a/qtip/utils/logger_utils.py
+++ b/qtip/utils/logger_utils.py
@@ -62,4 +62,7 @@ class QtipLogger(Logger):
file_path = '{}/qtip/logs'.format(os.environ['HOME'])
def __init__(self, logger_name):
+ if not os.path.exists(self.file_path):
+ os.makedirs(self.file_path)
+
super(QtipLogger, self).__init__(logger_name)
diff --git a/tox.ini b/tox.ini
index 0ca99932..19a2a11e 100644
--- a/tox.ini
+++ b/tox.ini
@@ -18,6 +18,7 @@ commands=
--basetemp={envtmpdir} \
{posargs}
setenv=
+ HOME = {envtmpdir}
PYTHONPATH = {toxinidir}
[testenv:pep8]