1. /home/opnfv can not be created in osx
2. when the log directory is not existed, anteater_logger.py will fail
3. add new added directory .reports into .gitignore
Change-Id: If3833bfbaf160d35afab1c71d3fab060a1164da6
Signed-off-by: Julien <zhang.jun3g@zte.com.cn>
.tox
*.retry
job_output/
+.reports/
[config]
-reports_dir = /home/opnfv/reports/
-anteater_log = /home/opnfv/anteater.log
-gate_checks = /home/opnfv/anteater/gatechecks.yaml
+reports_dir = .reports/
+anteater_log = .reports/anteater.log
+gate_checks = ./gatechecks.yaml
import ConfigParser
import logging
+import os
config = ConfigParser.RawConfigParser()
config.read('anteater.conf')
ch.setLevel(logging.DEBUG)
self.logger.addHandler(ch)
+ # create the directory if not existed
+ path = os.path.dirname(anteater_log)
+ if ( False == os.path.exists(path)):
+ try:
+ os.makedirs(path)
+ except OSError as e:
+ raise e
+
handler = logging.FileHandler(anteater_log)
handler.setFormatter(formatter)
handler.setLevel(logging.DEBUG)