From 959b08bb6f93a5fe6dfe075249d4ef7186c2a73e Mon Sep 17 00:00:00 2001 From: Sagi Shnaidman Date: Mon, 10 May 2021 16:30:18 +0300 Subject: [PATCH] Remove duplicate base_url set from args Fix #88 Signed-off-by: Sagi Shnaidman --- README.md | 2 +- podman/client.py | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 7edb339f..2e8479b1 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ from podman import PodmanClient uri = "unix:///run/user/1000/podman/podman.sock" -with PodmanClient(uri) as client: +with PodmanClient(base_url=uri) as client: version = client.version() print("Release: ", version["Version"]) print("Compatible API: ", version["ApiVersion"]) diff --git a/podman/client.py b/podman/client.py index 89528f29..726b64c9 100644 --- a/podman/client.py +++ b/podman/client.py @@ -28,11 +28,10 @@ class PodmanClient(AbstractContextManager): Examples: - with PodmanClient("ssh://root@api.example:22/run/podman/podman.sock?secure=True", + with PodmanClient(base_url="ssh://root@api.example:22/run/podman/podman.sock?secure=True", identity="~alice/.ssh/api_ed25519") """ - - def __init__(self, *args, **kwargs) -> None: + def __init__(self, **kwargs) -> None: """Initialize PodmanClient. Keyword Args: @@ -73,7 +72,7 @@ def __init__(self, *args, **kwargs) -> None: Path(xdg.BaseDirectory.get_runtime_dir(strict=False)) / "podman" / "podman.sock" ) api_kwargs["base_url"] = "http+unix://" + path - self.api = APIClient(*args, **api_kwargs) + self.api = APIClient(**api_kwargs) def __enter__(self) -> "PodmanClient": return self