summaryrefslogtreecommitdiff
path: root/test/python/docker/__init__.py
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-03-01 14:20:49 -0800
committerGitHub <noreply@github.com>2021-03-01 14:20:49 -0800
commit8af66806c8042501ca32e66efdeb463cf5346cab (patch)
tree1ed8c48b6187a80b3822cf41431e92972fb0ad20 /test/python/docker/__init__.py
parent73044b28172fd0df23836052a9061dc41f51f39a (diff)
parent7927fe01f165bb4a3f381601d847036a3a130182 (diff)
downloadpodman-8af66806c8042501ca32e66efdeb463cf5346cab.tar.gz
podman-8af66806c8042501ca32e66efdeb463cf5346cab.tar.bz2
podman-8af66806c8042501ca32e66efdeb463cf5346cab.zip
Merge pull request #9556 from jwhonce/wip/docker
Refactor python tests to run against python3.9
Diffstat (limited to 'test/python/docker/__init__.py')
-rw-r--r--test/python/docker/__init__.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/test/python/docker/__init__.py b/test/python/docker/__init__.py
index 351834316..da5630eac 100644
--- a/test/python/docker/__init__.py
+++ b/test/python/docker/__init__.py
@@ -8,7 +8,7 @@ import tempfile
from docker import DockerClient
-from test.python.docker import constant
+from .compat import constant
class Podman(object):
@@ -39,7 +39,9 @@ class Podman(object):
self.cmd.append("--root=" + os.path.join(self.anchor_directory, "crio"))
self.cmd.append("--runroot=" + os.path.join(self.anchor_directory, "crio-run"))
- os.environ["REGISTRIES_CONFIG_PATH"] = os.path.join(self.anchor_directory, "registry.conf")
+ os.environ["REGISTRIES_CONFIG_PATH"] = os.path.join(
+ self.anchor_directory, "registry.conf"
+ )
p = configparser.ConfigParser()
p.read_dict(
{
@@ -51,10 +53,14 @@ class Podman(object):
with open(os.environ["REGISTRIES_CONFIG_PATH"], "w") as w:
p.write(w)
- os.environ["CNI_CONFIG_PATH"] = os.path.join(self.anchor_directory, "cni", "net.d")
+ os.environ["CNI_CONFIG_PATH"] = os.path.join(
+ self.anchor_directory, "cni", "net.d"
+ )
os.makedirs(os.environ["CNI_CONFIG_PATH"], exist_ok=True)
self.cmd.append("--cni-config-dir=" + os.environ["CNI_CONFIG_PATH"])
- cni_cfg = os.path.join(os.environ["CNI_CONFIG_PATH"], "87-podman-bridge.conflist")
+ cni_cfg = os.path.join(
+ os.environ["CNI_CONFIG_PATH"], "87-podman-bridge.conflist"
+ )
# json decoded and encoded to ensure legal json
buf = json.loads(
"""