Skip to content

Commit 9687115

Browse files
committed
Drop packaging requirement and unpin docker-py
Change-Id: I11d306be5e5bb3d5b05b50dd8ee64ac9424854a1
1 parent 91f91e1 commit 9687115

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

kolla/image/build.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -113,16 +113,13 @@ def run_build():
113113
if conf.engine == engine.Engine.DOCKER.value:
114114
try:
115115
import docker
116-
import packaging
117-
packaging.version.parse(docker.__version__)
118-
except ImportError:
116+
docker.__version__
117+
except ImportError as e:
119118
LOG.error("Error, you have set Docker as container engine, "
120119
"but the Python library is not found."
121-
"Try running 'pip install docker'")
120+
"Try running 'pip install docker'\n"
121+
"Python error: %s", e)
122122
sys.exit(1)
123-
except AttributeError:
124-
LOG.error("Error, Docker Python library is too old, "
125-
"Try running 'pip install docker --upgrade'")
126123
if conf.squash:
127124
squash_version = utils.get_docker_squash_version()
128125
LOG.info('Image squash is enabled and "docker-squash" version '
@@ -132,10 +129,11 @@ def run_build():
132129
try:
133130
import podman
134131
podman.__version__
135-
except ImportError:
136-
LOG.error("Error, you have set podman as container engine, "
137-
"but library is not found."
138-
"Try running pip install podman")
132+
except ImportError as e:
133+
LOG.error("Error, you have set Podman as container engine, "
134+
"but the Python library is not found."
135+
"Try running 'pip install podman'\n"
136+
"Python error: %s", e)
139137
exit(1)
140138

141139
kolla = KollaWorker(conf)

tests/playbooks/pre.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
command: "{{ virtualenv_path }}/bin/python -m pip install {{ zuul.project.src_dir }}"
4444

4545
- name: Install docker python library
46-
command: "{{ virtualenv_path }}/bin/python -m pip install 'docker<7'"
46+
command: "{{ virtualenv_path }}/bin/python -m pip install docker"
4747
when: container_engine == "docker"
4848

4949
- name: Install podman python library

0 commit comments

Comments
 (0)