diff options
Diffstat (limited to 'kvmd/apps')
-rw-r--r-- | kvmd/apps/ipmi/__init__.py | 4 | ||||
-rw-r--r-- | kvmd/apps/kvmd/streamer.py | 7 | ||||
-rw-r--r-- | kvmd/apps/vnc/__init__.py | 4 |
3 files changed, 7 insertions, 8 deletions
diff --git a/kvmd/apps/ipmi/__init__.py b/kvmd/apps/ipmi/__init__.py index 54e15513..52145337 100644 --- a/kvmd/apps/ipmi/__init__.py +++ b/kvmd/apps/ipmi/__init__.py @@ -25,7 +25,7 @@ from typing import Optional from ...clients.kvmd import KvmdClient -from ... import make_user_agent +from ... import htclient from .. import init @@ -45,7 +45,7 @@ def main(argv: Optional[List[str]]=None) -> None: IpmiServer( auth_manager=IpmiAuthManager(**config.auth._unpack()), kvmd=KvmdClient( - user_agent=make_user_agent("KVMD-IPMI"), + user_agent=htclient.make_user_agent("KVMD-IPMI"), **config.kvmd._unpack(), ), **config.server._unpack(), diff --git a/kvmd/apps/kvmd/streamer.py b/kvmd/apps/kvmd/streamer.py index cc8b9d29..357a46bb 100644 --- a/kvmd/apps/kvmd/streamer.py +++ b/kvmd/apps/kvmd/streamer.py @@ -36,10 +36,9 @@ import aiohttp from ...logging import get_logger from ... import aiotools +from ... import htclient from ... import gpio -from ... import make_user_agent - # ===== class Streamer: # pylint: disable=too-many-instance-attributes @@ -182,7 +181,7 @@ class Streamer: # pylint: disable=too-many-instance-attributes session = self.__ensure_http_session() try: async with session.get(self.__make_url("state")) as response: - aiotools.raise_not_200(response) + htclient.raise_not_200(response) state = (await response.json())["result"] except (aiohttp.ClientConnectionError, aiohttp.ServerConnectionError): pass @@ -245,7 +244,7 @@ class Streamer: # pylint: disable=too-many-instance-attributes def __ensure_http_session(self) -> aiohttp.ClientSession: if not self.__http_session: kwargs: Dict = { - "headers": {"User-Agent": make_user_agent("KVMD")}, + "headers": {"User-Agent": htclient.make_user_agent("KVMD")}, "timeout": aiohttp.ClientTimeout(total=self.__timeout), } if self.__unix_path: diff --git a/kvmd/apps/vnc/__init__.py b/kvmd/apps/vnc/__init__.py index a88a3966..aaf67740 100644 --- a/kvmd/apps/vnc/__init__.py +++ b/kvmd/apps/vnc/__init__.py @@ -26,7 +26,7 @@ from typing import Optional from ...clients.kvmd import KvmdClient from ...clients.streamer import StreamerClient -from ... import make_user_agent +from ... import htclient from .. import init @@ -42,7 +42,7 @@ def main(argv: Optional[List[str]]=None) -> None: argv=argv, )[2].vnc - user_agent = make_user_agent("KVMD-VNC") + user_agent = htclient.make_user_agent("KVMD-VNC") # pylint: disable=protected-access VncServer( |