Debian Codegraph @

ansible_collections/community/docker/plugins/plugin_utils/_socket_handler.py

raw
1 # Copyright (c) 2019-2020, Felix Fontein <[email protected]>
2 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
3 # SPDX-License-Identifier: GPL-3.0-or-later
4
5 # Note that this module util is **PRIVATE** to the collection. It can have breaking changes at any time.
6 # Do not use this from other collections or standalone plugins/modules!
7
8 from __future__ import annotations
9
10 import typing as t
11
12 from ansible_collections.community.docker.plugins.module_utils._socket_handler import (
13 DockerSocketHandlerBase,
14 )
15
16 if t.TYPE_CHECKING:
17 from ansible.utils.display import Display
18
19 from ansible_collections.community.docker.plugins.module_utils._socket_helper import (
20 SocketLike,
21 )
22
23
24 class DockerSocketHandler(DockerSocketHandlerBase):
25 def __init__(
26 self, display: Display, sock: SocketLike, container: str | None = None
27 ) -> None:
28 super().__init__(sock, log=lambda msg: display.vvvv(msg, host=container))