diff options
author | Maxim Devaev <[email protected]> | 2022-03-27 22:50:35 +0300 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2022-03-27 22:50:35 +0300 |
commit | 056f0693466104180beb201b9eb45ff0d04babca (patch) | |
tree | 95133f38bdcd7b46f43af7a23471cc886aed9e76 /kvmd/clients/kvmd.py | |
parent | 8775cd22860a21d5b93dc3c691e25d33571e02eb (diff) |
removed unused network code and simplified configs
Diffstat (limited to 'kvmd/clients/kvmd.py')
-rw-r--r-- | kvmd/clients/kvmd.py | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/kvmd/clients/kvmd.py b/kvmd/clients/kvmd.py index d3d91094..84576fb2 100644 --- a/kvmd/clients/kvmd.py +++ b/kvmd/clients/kvmd.py @@ -245,15 +245,11 @@ class KvmdClientSession: class KvmdClient: def __init__( self, - host: str, - port: int, unix_path: str, timeout: float, user_agent: str, ) -> None: - self.__host = host - self.__port = port self.__unix_path = unix_path self.__timeout = timeout self.__user_agent = user_agent @@ -271,12 +267,11 @@ class KvmdClient: "X-KVMD-Passwd": passwd, "User-Agent": self.__user_agent, }, + "connector": aiohttp.UnixConnector(path=self.__unix_path), "timeout": aiohttp.ClientTimeout(total=self.__timeout), } - if self.__unix_path: - kwargs["connector"] = aiohttp.UnixConnector(path=self.__unix_path) return aiohttp.ClientSession(**kwargs) def __make_url(self, handle: str) -> str: assert not handle.startswith("/"), handle - return f"http://{self.__host}:{self.__port}/{handle}" + return f"http://localhost:0/{handle}" |