Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
Odoo scripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
XCG
Odoo scripts
Commits
94093b0ddc42
Commit
94093b0ddc42
authored
6 years ago
by
Vincent Hatakeyama
Browse files
Options
Downloads
Patches
Plain Diff
also add option for dbport in do_tests create and drop commands
parent
34b9d0036116
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
do_tests.py
+14
-10
14 additions, 10 deletions
do_tests.py
with
14 additions
and
10 deletions
do_tests.py
+
14
−
10
View file @
94093b0d
...
...
@@ -126,7 +126,7 @@
'
-p
'
,
'
--dbport
'
,
help
=
"
Database port [default: %(default)s]
"
,
default
=
'
5432
'
,
default
=
None
,
)
# TODO options
# - db host/uri (include socket)
...
...
@@ -216,9 +216,12 @@
if
odoo_db_password
:
args
.
append
(
'
--db_password
'
)
args
.
append
(
odoo_db_password
)
if
dbport
:
args
.
append
(
'
--dbport
'
)
args
.
append
(
dbport
)
docker_dev_start
.
flake8
()
if
recreate_db
:
# XXX use psycopg2
# drop database
logging
.
info
(
"
Drop any existing database %s
"
,
dbname
)
...
...
@@ -219,10 +222,14 @@
docker_dev_start
.
flake8
()
if
recreate_db
:
# XXX use psycopg2
# drop database
logging
.
info
(
"
Drop any existing database %s
"
,
dbname
)
result
=
call
([
'
dropdb
'
,
dbname
,
'
--if-exists
'
,
'
--no-password
'
])
dropdb
=
[
'
dropdb
'
,
dbname
,
'
--if-exists
'
,
'
--no-password
'
]
if
dbport
:
dropdb
.
append
(
'
-p
'
)
dropdb
.
append
(
dbport
)
result
=
call
(
dropdb
)
if
result
:
return
result
# create database
...
...
@@ -231,8 +238,11 @@
logging
.
fatal
(
'
Owner of database is mandatory when creating database
'
)
return
14
result
=
call
(
[
'
createdb
'
,
dbname
,
'
-O
'
,
odoo_db_user
,
'
--no-password
'
])
create_db
=
[
'
createdb
'
,
dbname
,
'
-O
'
,
odoo_db_user
,
'
--no-password
'
]
if
dbport
:
create_db
.
append
(
'
-p
'
)
create_db
.
append
(
dbport
)
result
=
call
(
create_db
)
if
result
:
return
result
# add unaccent if needed
...
...
@@ -253,9 +263,6 @@
if
install_log_level
:
install_args
.
append
(
'
--log-level
'
)
install_args
.
append
(
install_log_level
)
if
dbport
:
install_args
.
append
(
'
--dbport
'
)
install_args
.
append
(
dbport
)
docker_dev_start
.
main
(
install_args
)
if
result
:
...
...
@@ -273,9 +280,6 @@
if
test_log_level
:
test_args
.
append
(
'
--log-level
'
)
test_args
.
append
(
test_log_level
)
if
dbport
:
test_args
.
append
(
'
--dbport
'
)
test_args
.
append
(
dbport
)
return
docker_dev_start
.
main
(
test_args
)
else
:
raise
NotImplementedError
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment