From 3dcbfe52cae8be4aef85990cf35c5ec8ac922580 Mon Sep 17 00:00:00 2001 From: Jonathan Dowland Date: Mon, 11 Mar 2024 15:11:18 +0000 Subject: [PATCH] Overhaul instantiating docker API class Don't pin docker APIClient to version 1.22. Don't try to instantiate docker.Client before trying docker.APIClient: the former dates from the days the library was called "docker-py", the last release for which was November 2016. EPEL 7 and onwards provide the newer Python docker library, so I doubt there's anyone left using the older one. This now aligns with Cekit. Signed-off-by: Jonathan Dowland --- steps/container.py | 5 +---- steps/image_steps.py | 7 +------ 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/steps/container.py b/steps/container.py index f169a97..4c9cc72 100644 --- a/steps/container.py +++ b/steps/container.py @@ -31,10 +31,7 @@ import tempfile import time -try: - d = docker.Client(version="1.22") -except: - d = docker.APIClient(version="1.22") +d = docker.APIClient() class ExecException(Exception): diff --git a/steps/image_steps.py b/steps/image_steps.py index 6b18ca7..9c536cc 100644 --- a/steps/image_steps.py +++ b/steps/image_steps.py @@ -3,12 +3,7 @@ from behave import then - -try: - DOCKER_CLIENT = docker.Client(version="1.22") -except: - DOCKER_CLIENT = docker.APIClient(version="1.22") - +DOCKER_CLIENT = docker.APIClient() @then(u'the image should contain label {label}') @then(u'the image should contain label {label} {check} value {value}')