Skip to content

Commit

Permalink
Overhaul instantiating docker API class
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
jmtd committed Mar 11, 2024
1 parent 40a940f commit 3dcbfe5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
5 changes: 1 addition & 4 deletions steps/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
7 changes: 1 addition & 6 deletions steps/image_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}')
Expand Down

0 comments on commit 3dcbfe5

Please sign in to comment.