diff --git a/podman/client.py b/podman/client.py index 6b95822e..546a7fd9 100644 --- a/podman/client.py +++ b/podman/client.py @@ -144,11 +144,7 @@ def from_env( "max_pool_size": max_pool_size, } - host = ( - environment.get("CONTAINER_HOST") - or environment.get("DOCKER_HOST") - or None - ) + host = environment.get("CONTAINER_HOST") or environment.get("DOCKER_HOST") or None if host is not None: kwargs["base_url"] = host diff --git a/podman/errors/exceptions.py b/podman/errors/exceptions.py index c403d95d..aaf2fb43 100644 --- a/podman/errors/exceptions.py +++ b/podman/errors/exceptions.py @@ -144,6 +144,7 @@ def __init__( class InvalidArgument(PodmanError): """Parameter to method/function was not valid.""" + class PodmanConnectionError(PodmanError): """Exception raised when connection to Podman service fails using environment configuration.""" diff --git a/podman/tests/integration/test_system.py b/podman/tests/integration/test_system.py index 08ffd5a8..1cf43af6 100644 --- a/podman/tests/integration/test_system.py +++ b/podman/tests/integration/test_system.py @@ -64,7 +64,7 @@ def test_login(self): def test_from_env(self): """integration: from_env() no error""" PodmanClient.from_env() - + def test_from_env_exceptions(self): """integration: from_env() returns exceptions""" with self.assertRaises(PodmanConnectionError):