From 7053020cfd7fc3ed93bdd83ca4b70a2e95818daa Mon Sep 17 00:00:00 2001 From: Ross Brattain Date: Sun, 13 Aug 2017 13:36:57 -0700 Subject: utils: create TASK_LOG_DIR if it doesn't exist Change-Id: I10630599065e6c159b137bd4d6ee89353a1c411b Signed-off-by: Ross Brattain --- yardstick/benchmark/core/task.py | 1 + 1 file changed, 1 insertion(+) (limited to 'yardstick/benchmark/core/task.py') diff --git a/yardstick/benchmark/core/task.py b/yardstick/benchmark/core/task.py index dd35bd4f4..9605e9426 100644 --- a/yardstick/benchmark/core/task.py +++ b/yardstick/benchmark/core/task.py @@ -162,6 +162,7 @@ class Task(object): # pragma: no cover log_format = '%(asctime)s %(name)s %(filename)s:%(lineno)d %(levelname)s %(message)s' log_formatter = logging.Formatter(log_format) + utils.makedirs(constants.TASK_LOG_DIR) log_path = os.path.join(constants.TASK_LOG_DIR, '{}.log'.format(self.task_id)) log_handler = logging.FileHandler(log_path) log_handler.setFormatter(log_formatter) -- cgit 1.2.3-korg