diff options
| author | Michal Nasiadka <mnasiadka@gmail.com> | 2024-05-23 15:14:53 +0200 |
|---|---|---|
| committer | Michal Nasiadka <mnasiadka@gmail.com> | 2024-05-28 08:19:28 +0000 |
| commit | 968711579fbe73316227bd2b1993c5656adad9f4 (patch) | |
| tree | 7d74b3d9466555ecb2fc8fe0b63b5e5ec82939eb | |
| parent | 91f91e1cc28942870e0fd01f039872c24d62c99b (diff) | |
| download | kolla-968711579fbe73316227bd2b1993c5656adad9f4.tar.gz kolla-968711579fbe73316227bd2b1993c5656adad9f4.zip | |
Drop packaging requirement and unpin docker-py
Change-Id: I11d306be5e5bb3d5b05b50dd8ee64ac9424854a1
| -rw-r--r-- | kolla/image/build.py | 20 | ||||
| -rw-r--r-- | tests/playbooks/pre.yml | 2 |
2 files changed, 10 insertions, 12 deletions
diff --git a/kolla/image/build.py b/kolla/image/build.py index 63e3ca81d..88189e2f7 100644 --- a/kolla/image/build.py +++ b/kolla/image/build.py @@ -113,16 +113,13 @@ def run_build(): if conf.engine == engine.Engine.DOCKER.value: try: import docker - import packaging - packaging.version.parse(docker.__version__) - except ImportError: + docker.__version__ + except ImportError as e: LOG.error("Error, you have set Docker as container engine, " "but the Python library is not found." - "Try running 'pip install docker'") + "Try running 'pip install docker'\n" + "Python error: %s", e) sys.exit(1) - except AttributeError: - LOG.error("Error, Docker Python library is too old, " - "Try running 'pip install docker --upgrade'") if conf.squash: squash_version = utils.get_docker_squash_version() LOG.info('Image squash is enabled and "docker-squash" version ' @@ -132,10 +129,11 @@ def run_build(): try: import podman podman.__version__ - except ImportError: - LOG.error("Error, you have set podman as container engine, " - "but library is not found." - "Try running pip install podman") + except ImportError as e: + LOG.error("Error, you have set Podman as container engine, " + "but the Python library is not found." + "Try running 'pip install podman'\n" + "Python error: %s", e) exit(1) kolla = KollaWorker(conf) diff --git a/tests/playbooks/pre.yml b/tests/playbooks/pre.yml index d80802bd4..7e44c87aa 100644 --- a/tests/playbooks/pre.yml +++ b/tests/playbooks/pre.yml @@ -43,7 +43,7 @@ command: "{{ virtualenv_path }}/bin/python -m pip install {{ zuul.project.src_dir }}" - name: Install docker python library - command: "{{ virtualenv_path }}/bin/python -m pip install 'docker<7'" + command: "{{ virtualenv_path }}/bin/python -m pip install docker" when: container_engine == "docker" - name: Install podman python library |
