mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-04-04 18:48:56 +00:00
Remove broken dead code.
This commit is contained in:
parent
f9cd56a985
commit
b49031ff19
@ -47,7 +47,7 @@ from ..transport.sshconn import PARAMIKO_IMPORT_ERROR, SSHHTTPAdapter
|
|||||||
from ..transport.ssladapter import SSLHTTPAdapter
|
from ..transport.ssladapter import SSLHTTPAdapter
|
||||||
from ..transport.unixconn import UnixHTTPAdapter
|
from ..transport.unixconn import UnixHTTPAdapter
|
||||||
from ..utils import config, json_stream, utils
|
from ..utils import config, json_stream, utils
|
||||||
from ..utils.decorators import check_resource, update_headers
|
from ..utils.decorators import update_headers
|
||||||
from ..utils.proxy import ProxyConfig
|
from ..utils.proxy import ProxyConfig
|
||||||
from ..utils.socket import consume_socket_output, demux_adaptor, frames_iter
|
from ..utils.socket import consume_socket_output, demux_adaptor, frames_iter
|
||||||
from .daemon import DaemonApiMixin
|
from .daemon import DaemonApiMixin
|
||||||
@ -460,14 +460,6 @@ class APIClient(_Session, DaemonApiMixin):
|
|||||||
|
|
||||||
s.settimeout(None)
|
s.settimeout(None)
|
||||||
|
|
||||||
@check_resource("container")
|
|
||||||
def _check_is_tty(self, container):
|
|
||||||
cont = self.inspect_container(container)
|
|
||||||
return cont["Config"]["Tty"]
|
|
||||||
|
|
||||||
def _get_result(self, container, stream, res):
|
|
||||||
return self._get_result_tty(stream, res, self._check_is_tty(container))
|
|
||||||
|
|
||||||
def _get_result_tty(self, stream, res, is_tty):
|
def _get_result_tty(self, stream, res, is_tty):
|
||||||
# We should also use raw streaming (without keep-alive)
|
# We should also use raw streaming (without keep-alive)
|
||||||
# if we are dealing with a tty-enabled container.
|
# if we are dealing with a tty-enabled container.
|
||||||
|
|||||||
@ -17,25 +17,6 @@ from .. import errors
|
|||||||
from . import utils
|
from . import utils
|
||||||
|
|
||||||
|
|
||||||
def check_resource(resource_name):
|
|
||||||
def decorator(f):
|
|
||||||
@functools.wraps(f)
|
|
||||||
def wrapped(
|
|
||||||
self, resource_id=None, *args, **kwargs
|
|
||||||
): # pylint: disable=keyword-arg-before-vararg
|
|
||||||
if resource_id is None and kwargs.get(resource_name):
|
|
||||||
resource_id = kwargs.pop(resource_name)
|
|
||||||
if isinstance(resource_id, dict):
|
|
||||||
resource_id = resource_id.get("Id", resource_id.get("ID"))
|
|
||||||
if not resource_id:
|
|
||||||
raise errors.NullResource("Resource ID was not provided")
|
|
||||||
return f(self, resource_id, *args, **kwargs)
|
|
||||||
|
|
||||||
return wrapped
|
|
||||||
|
|
||||||
return decorator
|
|
||||||
|
|
||||||
|
|
||||||
def minimum_version(version):
|
def minimum_version(version):
|
||||||
def decorator(f):
|
def decorator(f):
|
||||||
@functools.wraps(f)
|
@functools.wraps(f)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user