Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
FUSS
fuss-manager
Commits
ba270780
Commit
ba270780
authored
Aug 11, 2020
by
Elena Grandi
Browse files
Create the directory for a JsonableLog before trying to write it
parent
99573a3e
Changes
2
Hide whitespace changes
Inline
Side-by-side
manager/manager.py
View file @
ba270780
...
...
@@ -16,6 +16,7 @@ class JsonableLog:
"""
def
__init__
(
self
,
pathname
):
self
.
pathname
=
pathname
os
.
makedirs
(
os
.
path
.
dirname
(
self
.
pathname
),
exist_ok
=
True
)
try
:
self
.
fd
=
open
(
self
.
pathname
,
"at"
)
except
FileNotFoundError
:
...
...
tests/test_operationlog.py
View file @
ba270780
...
...
@@ -48,4 +48,4 @@ class TestOperationLog(TestCase):
oplog
.
log
(
ops
.
Noop
())
oplog
.
close
()
self
.
assert
Fals
e
(
os
.
path
.
exists
(
pathname
))
self
.
assert
Tru
e
(
os
.
path
.
exists
(
pathname
))
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