Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Matevz Golob
erp5
Commits
4d6f43f4
Commit
4d6f43f4
authored
Oct 28, 2011
by
Nicolas Delaby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure to always use the same absolute path to handle the sql dump
parent
8b8e4cfc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
product/ERP5Type/tests/custom_zodb.py
product/ERP5Type/tests/custom_zodb.py
+5
-5
No files found.
product/ERP5Type/tests/custom_zodb.py
View file @
4d6f43f4
...
...
@@ -38,12 +38,13 @@ load = int(os.environ.get('erp5_load_data_fs', 0))
save
=
int
(
os
.
environ
.
get
(
'erp5_save_data_fs'
,
0
))
save_mysql
=
int
(
os
.
environ
.
get
(
'erp5_dump_sql'
)
or
not
zeo_client
)
or
None
dump_sql_path
=
os
.
path
.
join
(
instance_home
,
'dump.sql'
)
if
save_mysql
:
def
save_mysql
(
verbosity
=
1
):
# The output of mysqldump needs to merge many lines at a time
# for performance reasons (merging lines is at most 10 times
# faster, so this produce somewhat not nice to read sql
command
=
'mysqldump %s > %s'
%
(
getMySQLArguments
(),
os
.
path
.
abspath
(
'dump.sql'
)
,)
command
=
'mysqldump %s > %s'
%
(
getMySQLArguments
(),
dump_sql_path
,)
if
verbosity
:
_print
(
'Dumping MySQL database with %s...'
%
command
)
os
.
system
(
command
)
...
...
@@ -58,13 +59,12 @@ for static_dir in static_dir_list:
if
load
:
if
save_mysql
:
dump_sql
=
os
.
path
.
join
(
instance_home
,
'dump.sql'
)
if
os
.
path
.
exists
(
dump_sql
):
if
os
.
path
.
exists
(
dump_sql_path
):
_print
(
"Restoring MySQL database ... "
)
ret
=
os
.
system
(
"mysql %s < %s"
%
(
getMySQLArguments
(),
dump_sql
))
ret
=
os
.
system
(
"mysql %s < %s"
%
(
getMySQLArguments
(),
dump_sql
_path
))
assert
not
ret
else
:
_print
(
"Could not find MySQL dump (%r), will recreate catalog ... "
%
dump_sql
)
_print
(
"Could not find MySQL dump (%r), will recreate catalog ... "
%
dump_sql
_path
)
os
.
environ
[
'erp5_tests_recreate_catalog'
]
=
'1'
_print
(
"Restoring static files ... "
)
live_instance_path
=
os
.
environ
.
get
(
'live_instance_path'
)
...
...
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