Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
jijisa
/
porch
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
e6a4e67a
authored
Mar 21, 2017
by
Heechul Kim
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Added mkdir log
parent
f655fbfe
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
porch/api/app/bizlogic.py
porch/api/machine/bizlogic.py
porch/api/app/bizlogic.py
View file @
e6a4e67a
...
@@ -198,6 +198,13 @@ def play_app(name, data):
...
@@ -198,6 +198,13 @@ def play_app(name, data):
# set logfile name
# set logfile name
s_date
=
datetime
.
now
()
.
isoformat
()
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
s_logfile
=
APP_LOG
+
'/'
+
s_date
# write to etcd /porch/log/app/<s_date>/{log: s_logfile}
# write to etcd /porch/log/app/<s_date>/{log: s_logfile}
s_rsc
=
'{}/log/app/{}'
.
format
(
etcdc
.
prefix
,
s_date
)
s_rsc
=
'{}/log/app/{}'
.
format
(
etcdc
.
prefix
,
s_date
)
...
@@ -305,6 +312,13 @@ def file_distribute_app(data):
...
@@ -305,6 +312,13 @@ def file_distribute_app(data):
# Let's distribute.
# Let's distribute.
# set logfile name
# set logfile name
s_date
=
datetime
.
now
()
.
isoformat
()
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
s_logfile
=
FILE_LOG
+
'/'
+
s_date
# write to etcd /porch/log/file/<s_date>/<data>
# write to etcd /porch/log/file/<s_date>/<data>
data
[
'log'
]
=
s_logfile
data
[
'log'
]
=
s_logfile
...
...
porch/api/machine/bizlogic.py
View file @
e6a4e67a
...
@@ -331,6 +331,13 @@ def install_machine(data):
...
@@ -331,6 +331,13 @@ def install_machine(data):
# set logfile name
# set logfile name
s_date
=
datetime
.
now
()
.
isoformat
()
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
s_logfile
=
OS_LOG
+
'/'
+
s_date
# write to etcd /porch/log/os/<s_date>/{log: s_logfile}
# write to etcd /porch/log/os/<s_date>/{log: s_logfile}
s_rsc
=
'{}/log/os/{}'
.
format
(
etcdc
.
prefix
,
s_date
)
s_rsc
=
'{}/log/os/{}'
.
format
(
etcdc
.
prefix
,
s_date
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment