Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
vidjil
vidjil
Commits
de12acb3
Commit
de12acb3
authored
Oct 09, 2020
by
marc duez
Browse files
migrator.py: rollback databases change if file copy fail
parent
445f2ce8
Pipeline
#175990
passed with stages
in 12 minutes and 3 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
server/web2py/applications/vidjil/scripts/migrator.py
View file @
de12acb3
...
...
@@ -372,9 +372,9 @@ def import_data(filesrc, filedest, groupid, config=None, pprocess=None, dry_run=
db
.
rollback
()
log
.
info
(
"dry run successful, no data saved"
)
else
:
db
.
commit
()
log
.
info
(
"copying files from %s to %s"
%
(
filesrc
,
filedest
))
copy_files
(
data
,
filesrc
+
'/files'
,
filedest
,
log
=
log
)
db
.
commit
()
log
.
info
(
"done"
)
except
:
log
.
error
(
"something went wrong, rolling back"
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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