Commit e6a4e67a by Heechul Kim

Added mkdir log

parent f655fbfe
......@@ -198,6 +198,13 @@ def play_app(name, data):
# set logfile name
s_date = datetime.now().isoformat()
try:
if not os.path.isdir(APP_LOG):
os.mkdir(APP_LOG)
except:
s_msg = 'Fail to create log dir {}'.format(APP_LOG)
return (False, s_msg)
s_logfile = APP_LOG +'/' + s_date
# write to etcd /porch/log/app/<s_date>/{log: s_logfile}
s_rsc = '{}/log/app/{}'.format(etcdc.prefix, s_date)
......@@ -305,6 +312,13 @@ def file_distribute_app(data):
# Let's distribute.
# set logfile name
s_date = datetime.now().isoformat()
try:
if not os.path.isdir(FILE_LOG):
os.mkdir(FILE_LOG)
except:
s_msg = 'Fail to create log dir {}'.format(FILE_LOG)
return (False, s_msg)
s_logfile = FILE_LOG + '/' + s_date
# write to etcd /porch/log/file/<s_date>/<data>
data['log'] = s_logfile
......
......@@ -331,6 +331,13 @@ def install_machine(data):
# set logfile name
s_date = datetime.now().isoformat()
try:
if not os.path.isdir(OS_LOG):
os.mkdir(OS_LOG)
except:
s_msg = 'Cannot create log dir {}'.format(OS_LOG)
log.error(s_msg)
return (False, s_msg)
s_logfile = OS_LOG + '/' + s_date
# write to etcd /porch/log/os/<s_date>/{log: s_logfile}
s_rsc = '{}/log/os/{}'.format(etcdc.prefix, s_date)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment