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
4b0f68b9216b
Commit
4b0f68b9216b
authored
6 years ago
by
Vincent Hatakeyama
Browse files
Options
Downloads
Patches
Plain Diff
make dev script compatible with newer python-docker as in
8b89c9943c1f
parent
d52e700bc720
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docker_dev_start.py
+7
-2
7 additions, 2 deletions
docker_dev_start.py
with
7 additions
and
2 deletions
docker_dev_start.py
+
7
−
2
View file @
4b0f68b9
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
import
ConfigParser
import
ConfigParser
import
docker
# apt python-docker (1.9)
import
docker
# apt python-docker (1.9)
or pip install docker
from
psycopg2
import
connect
,
OperationalError
# apt python-psycopg2
from
psycopg2
import
connect
,
OperationalError
# apt python-psycopg2
from
requests.exceptions
import
ConnectionError
from
requests.exceptions
import
ConnectionError
...
@@ -17,6 +17,11 @@
...
@@ -17,6 +17,11 @@
from
psycopg2
import
connect
,
OperationalError
# apt python-psycopg2
from
psycopg2
import
connect
,
OperationalError
# apt python-psycopg2
from
requests.exceptions
import
ConnectionError
from
requests.exceptions
import
ConnectionError
if
docker
.
__version__
>
'
3.0.0
'
:
from
docker
import
APIClient
as
docker_api
else
:
from
docker
import
Client
as
docker_api
# TODO auto create list of module
# TODO auto create list of module
_logger
=
logging
.
getLogger
(
__name__
)
_logger
=
logging
.
getLogger
(
__name__
)
...
@@ -241,7 +246,7 @@
...
@@ -241,7 +246,7 @@
c
.
get
(
'
odoo_scripts
'
,
'
postgresql_version
'
))
or
'
9.6
'
c
.
get
(
'
odoo_scripts
'
,
'
postgresql_version
'
))
or
'
9.6
'
logging
.
debug
(
"
Docker image: %s
"
,
image
)
logging
.
debug
(
"
Docker image: %s
"
,
image
)
# detect if docker image already exists
# detect if docker image already exists
docker_client
=
docker
.
Client
(
base_url
=
'
unix://var/run/docker.sock
'
)
docker_client
=
docker
_api
(
base_url
=
'
unix://var/run/docker.sock
'
)
image_list
=
docker_client
.
images
(
name
=
image
,
quiet
=
True
)
image_list
=
docker_client
.
images
(
name
=
image
,
quiet
=
True
)
if
not
image_list
:
if
not
image_list
:
logging
.
warn
(
"
Image %s does not exist
"
,
image
)
logging
.
warn
(
"
Image %s does not exist
"
,
image
)
...
...
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