use os.makedirs with exist_ok to create log directory

Should fix LP: #1617236
This commit is contained in:
Michael Hudson-Doyle 2016-08-30 10:50:20 +12:00
parent 69ab3ef696
commit f79c82a367
1 changed files with 1 additions and 2 deletions

View File

@ -25,8 +25,7 @@ LOGFILE = os.path.join(LOGDIR, "subiquity-debug.log")
def setup_logger(name=__name__, dir=LOGDIR):
LOGFILE = os.path.join(dir, "subiquity-debug.log")
try:
if not os.path.isdir(dir):
os.makedirs(dir)
os.makedirs(dir, exist_ok=True)
log = TimedRotatingFileHandler(LOGFILE,
when='D',
interval=1,