Skip to content

Commit

Permalink
Merge pull request #89 from sshnaidm/fixbu
Browse files Browse the repository at this point in the history
Remove duplicate base_url set from args
  • Loading branch information
jwhonce authored May 10, 2021
2 parents 724cdb9 + 959b08b commit bdd5cf4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Expand Down
7 changes: 3 additions & 4 deletions podman/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,10 @@ class PodmanClient(AbstractContextManager):
Examples:
with PodmanClient("ssh://[email protected]:22/run/podman/podman.sock?secure=True",
with PodmanClient(base_url="ssh://[email protected]: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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit bdd5cf4

Please sign in to comment.