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
b79256b2
Commit
b79256b2
authored
3 years ago
by
Vincent Hatakeyama
Browse files
Options
Downloads
Patches
Plain Diff
fix start-py3o
The code was still using old API, updated it.
parent
8ffb3e01
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!44
🚑 fix start-py3o
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
NEWS.rst
+2
-0
2 additions, 0 deletions
NEWS.rst
odoo_scripts/docker_py3o.py
+15
-14
15 additions, 14 deletions
odoo_scripts/docker_py3o.py
with
17 additions
and
14 deletions
NEWS.rst
+
2
−
0
View file @
b79256b2
...
...
@@ -11,6 +11,8 @@
Changed following base image changes.
Make start-py3o option work again.
8.0.1
-----
...
...
This diff is collapsed.
Click to expand it.
odoo_scripts/docker_py3o.py
+
15
−
14
View file @
b79256b2
...
...
@@ -33,7 +33,10 @@
fusion_name
=
"
py3o_fusion
"
fusion_image
=
"
{}:{}
"
.
format
(
fusion_repository
,
fusion_version
)
try
:
docker_client
.
pull
(
repository
=
fusion_repository
,
tag
=
fusion_version
)
_logger
.
debug
(
"
Pulling %s
"
,
fusion_repository
)
docker_client
.
images
.
pull
(
repository
=
fusion_repository
,
tag
=
fusion_version
)
except
Exception
as
e
:
_logger
.
warning
(
"
Exception when trying to pull: %s
"
,
e
)
if
any
(
...
...
@@ -37,10 +40,10 @@
except
Exception
as
e
:
_logger
.
warning
(
"
Exception when trying to pull: %s
"
,
e
)
if
any
(
"
/{}
"
.
format
(
fusion_name
)
in
container
[
"
Names
"
]
for
container
in
docker_client
.
containers
()
fusion_name
==
container
.
name
for
container
in
docker_client
.
containers
.
list
()
):
_logger
.
debug
(
"
%s Container already running
"
,
fusion_name
)
remove_and_stop
(
docker_client
,
fusion_name
)
# TODO handle --host-network option
port_bindings
=
{
8765
:
host_fusion_port
}
...
...
@@ -42,9 +45,6 @@
):
_logger
.
debug
(
"
%s Container already running
"
,
fusion_name
)
remove_and_stop
(
docker_client
,
fusion_name
)
# TODO handle --host-network option
port_bindings
=
{
8765
:
host_fusion_port
}
host_config
=
docker_client
.
create_host_config
(
binds
=
[],
port_bindings
=
port_bindings
)
_logger
.
debug
(
"
Starting %s container
"
,
fusion_name
)
...
...
@@ -50,5 +50,5 @@
_logger
.
debug
(
"
Starting %s container
"
,
fusion_name
)
fusion
=
docker_client
.
create_
container
(
image
=
fusion_image
,
host_config
=
host_config
,
name
=
fusion_name
fusion
=
docker_client
.
container
s
.
create
(
image
=
fusion_image
,
ports
=
port_bindings
,
name
=
fusion_name
)
_logger
.
debug
(
"
Starting %s container
"
,
fusion_name
)
...
...
@@ -53,5 +53,5 @@
)
_logger
.
debug
(
"
Starting %s container
"
,
fusion_name
)
docker_client
.
start
(
container
=
fusion
.
get
(
"
Id
"
)
)
fusion
.
start
(
)
def
stop_py3o
():
...
...
@@ -56,10 +56,11 @@
def
stop_py3o
():
# TODO test if still exists
_logger
.
info
(
"
Stopping fusion
"
)
docker_client
.
stop
(
fusion
.
get
(
"
Id
"
))
_logger
.
info
(
"
Removing containers
"
)
docker_client
.
remove_container
(
fusion
.
get
(
"
Id
"
))
# TODO test if still exists (no error if already stopped)
_logger
.
info
(
"
Stopping fusion container
"
)
fusion
.
stop
()
fusion
.
wait
()
_logger
.
info
(
"
Removing fusion container
"
)
fusion
.
remove
()
if
stop_at_exit
:
atexit
.
register
(
stop_py3o
)
...
...
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