man-group / pytest-plugins

A grab-bag of nifty pytest plugins
MIT License
568 stars 85 forks source link

test_init fails (does it require a network connection?) #177

Open mcepl opened 3 years ago

mcepl commented 3 years ago

All builds (and running test suites as part of them) of OpenSUSE packages (the same for every other Linux or Mac distribution) happen in the chrooted environment without the network access, which makes running of the test suite for this package extremely awkward. Is this the case with test_init?

[   63s] __________________________________ test_init ___________________________________
[   63s] 
[   63s] self = <docker.transport.unixconn.UnixHTTPConnectionPool object at 0x7f8bc80e8e48>
[   63s] method = 'GET', url = '/version', body = None
[   63s] headers = {'User-Agent': 'docker-sdk-python/4.4.4', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'}
[   63s] retries = Retry(total=0, connect=None, read=False, redirect=None, status=None)
[   63s] redirect = False, assert_same_host = False
[   63s] timeout = Timeout(connect=60, read=60, total=None), pool_timeout = None
[   63s] release_conn = False, chunked = False, body_pos = None
[   63s] response_kw = {'decode_content': False, 'preload_content': False}
[   63s] parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/version', query=None, fragment=None)
[   63s] destination_scheme = None, conn = None, release_this_conn = True
[   63s] http_tunnel_required = False, err = None, clean_exit = False
[   63s] 
[   63s]     def urlopen(
[   63s]         self,
[   63s]         method,
[   63s]         url,
[   63s]         body=None,
[   63s]         headers=None,
[   63s]         retries=None,
[   63s]         redirect=True,
[   63s]         assert_same_host=True,
[   63s]         timeout=_Default,
[   63s]         pool_timeout=None,
[   63s]         release_conn=None,
[   63s]         chunked=False,
[   63s]         body_pos=None,
[   63s]         **response_kw
[   63s]     ):
[   63s]         """
[   63s]         Get a connection from the pool and perform an HTTP request. This is the
[   63s]         lowest level call for making a request, so you'll need to specify all
[   63s]         the raw details.
[   63s]     
[   63s]         .. note::
[   63s]     
[   63s]            More commonly, it's appropriate to use a convenience method provided
[   63s]            by :class:`.RequestMethods`, such as :meth:`request`.
[   63s]     
[   63s]         .. note::
[   63s]     
[   63s]            `release_conn` will only behave as expected if
[   63s]            `preload_content=False` because we want to make
[   63s]            `preload_content=False` the default behaviour someday soon without
[   63s]            breaking backwards compatibility.
[   63s]     
[   63s]         :param method:
[   63s]             HTTP request method (such as GET, POST, PUT, etc.)
[   63s]     
[   63s]         :param url:
[   63s]             The URL to perform the request on.
[   63s]     
[   63s]         :param body:
[   63s]             Data to send in the request body, either :class:`str`, :class:`bytes`,
[   63s]             an iterable of :class:`str`/:class:`bytes`, or a file-like object.
[   63s]     
[   63s]         :param headers:
[   63s]             Dictionary of custom headers to send, such as User-Agent,
[   63s]             If-None-Match, etc. If None, pool headers are used. If provided,
[   63s]             these headers completely replace any pool-specific headers.
[   63s]     
[   63s]         :param retries:
[   63s]             Configure the number of retries to allow before raising a
[   63s]             :class:`~urllib3.exceptions.MaxRetryError` exception.
[   63s]     
[   63s]             Pass ``None`` to retry until you receive a response. Pass a
[   63s]             :class:`~urllib3.util.retry.Retry` object for fine-grained control
[   63s]             over different types of retries.
[   63s]             Pass an integer number to retry connection errors that many times,
[   63s]             but no other types of errors. Pass zero to never retry.
[   63s]     
[   63s]             If ``False``, then retries are disabled and any exception is raised
[   63s]             immediately. Also, instead of raising a MaxRetryError on redirects,
[   63s]             the redirect response will be returned.
[   63s]     
[   63s]         :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int.
[   63s]     
[   63s]         :param redirect:
[   63s]             If True, automatically handle redirects (status codes 301, 302,
[   63s]             303, 307, 308). Each redirect counts as a retry. Disabling retries
[   63s]             will disable redirect, too.
[   63s]     
[   63s]         :param assert_same_host:
[   63s]             If ``True``, will make sure that the host of the pool requests is
[   63s]             consistent else will raise HostChangedError. When ``False``, you can
[   63s]             use the pool on an HTTP proxy and request foreign hosts.
[   63s]     
[   63s]         :param timeout:
[   63s]             If specified, overrides the default timeout for this one
[   63s]             request. It may be a float (in seconds) or an instance of
[   63s]             :class:`urllib3.util.Timeout`.
[   63s]     
[   63s]         :param pool_timeout:
[   63s]             If set and the pool is set to block=True, then this method will
[   63s]             block for ``pool_timeout`` seconds and raise EmptyPoolError if no
[   63s]             connection is available within the time period.
[   63s]     
[   63s]         :param release_conn:
[   63s]             If False, then the urlopen call will not release the connection
[   63s]             back into the pool once a response is received (but will release if
[   63s]             you read the entire contents of the response such as when
[   63s]             `preload_content=True`). This is useful if you're not preloading
[   63s]             the response's content immediately. You will need to call
[   63s]             ``r.release_conn()`` on the response ``r`` to return the connection
[   63s]             back into the pool. If None, it takes the value of
[   63s]             ``response_kw.get('preload_content', True)``.
[   63s]     
[   63s]         :param chunked:
[   63s]             If True, urllib3 will send the body using chunked transfer
[   63s]             encoding. Otherwise, urllib3 will send the body using the standard
[   63s]             content-length form. Defaults to False.
[   63s]     
[   63s]         :param int body_pos:
[   63s]             Position to seek to in file-like body in the event of a retry or
[   63s]             redirect. Typically this won't need to be set because urllib3 will
[   63s]             auto-populate the value when needed.
[   63s]     
[   63s]         :param \\**response_kw:
[   63s]             Additional parameters are passed to
[   63s]             :meth:`urllib3.response.HTTPResponse.from_httplib`
[   63s]         """
[   63s]     
[   63s]         parsed_url = parse_url(url)
[   63s]         destination_scheme = parsed_url.scheme
[   63s]     
[   63s]         if headers is None:
[   63s]             headers = self.headers
[   63s]     
[   63s]         if not isinstance(retries, Retry):
[   63s]             retries = Retry.from_int(retries, redirect=redirect, default=self.retries)
[   63s]     
[   63s]         if release_conn is None:
[   63s]             release_conn = response_kw.get("preload_content", True)
[   63s]     
[   63s]         # Check host
[   63s]         if assert_same_host and not self.is_same_host(url):
[   63s]             raise HostChangedError(self, url, retries)
[   63s]     
[   63s]         # Ensure that the URL we're connecting to is properly encoded
[   63s]         if url.startswith("/"):
[   63s]             url = six.ensure_str(_encode_target(url))
[   63s]         else:
[   63s]             url = six.ensure_str(parsed_url.url)
[   63s]     
[   63s]         conn = None
[   63s]     
[   63s]         # Track whether `conn` needs to be released before
[   63s]         # returning/raising/recursing. Update this variable if necessary, and
[   63s]         # leave `release_conn` constant throughout the function. That way, if
[   63s]         # the function recurses, the original value of `release_conn` will be
[   63s]         # passed down into the recursive call, and its value will be respected.
[   63s]         #
[   63s]         # See issue #651 [1] for details.
[   63s]         #
[   63s]         # [1] <https://github.com/urllib3/urllib3/issues/651>
[   63s]         release_this_conn = release_conn
[   63s]     
[   63s]         http_tunnel_required = connection_requires_http_tunnel(
[   63s]             self.proxy, self.proxy_config, destination_scheme
[   63s]         )
[   63s]     
[   63s]         # Merge the proxy headers. Only done when not using HTTP CONNECT. We
[   63s]         # have to copy the headers dict so we can safely change it without those
[   63s]         # changes being reflected in anyone else's copy.
[   63s]         if not http_tunnel_required:
[   63s]             headers = headers.copy()
[   63s]             headers.update(self.proxy_headers)
[   63s]     
[   63s]         # Must keep the exception bound to a separate variable or else Python 3
[   63s]         # complains about UnboundLocalError.
[   63s]         err = None
[   63s]     
[   63s]         # Keep track of whether we cleanly exited the except block. This
[   63s]         # ensures we do proper cleanup in finally.
[   63s]         clean_exit = False
[   63s]     
[   63s]         # Rewind body position, if needed. Record current position
[   63s]         # for future rewinds in the event of a redirect/retry.
[   63s]         body_pos = set_file_position(body, body_pos)
[   63s]     
[   63s]         try:
[   63s]             # Request a connection from the queue.
[   63s]             timeout_obj = self._get_timeout(timeout)
[   63s]             conn = self._get_conn(timeout=pool_timeout)
[   63s]     
[   63s]             conn.timeout = timeout_obj.connect_timeout
[   63s]     
[   63s]             is_new_proxy_conn = self.proxy is not None and not getattr(
[   63s]                 conn, "sock", None
[   63s]             )
[   63s]             if is_new_proxy_conn and http_tunnel_required:
[   63s]                 self._prepare_proxy(conn)
[   63s]     
[   63s]             # Make the request on the httplib connection object.
[   63s]             httplib_response = self._make_request(
[   63s]                 conn,
[   63s]                 method,
[   63s]                 url,
[   63s]                 timeout=timeout_obj,
[   63s]                 body=body,
[   63s]                 headers=headers,
[   63s] >               chunked=chunked,
[   63s]             )
[   63s] 
[   63s] /usr/lib/python3.6/site-packages/urllib3/connectionpool.py:706: 
[   63s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   63s] 
[   63s] self = <docker.transport.unixconn.UnixHTTPConnectionPool object at 0x7f8bc80e8e48>
[   63s] conn = <docker.transport.unixconn.UnixHTTPConnection object at 0x7f8bc80ef358>
[   63s] method = 'GET', url = '/version'
[   63s] timeout = Timeout(connect=60, read=60, total=None), chunked = False
[   63s] httplib_request_kw = {'body': None, 'headers': {'User-Agent': 'docker-sdk-python/4.4.4', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'}}
[   63s] timeout_obj = Timeout(connect=60, read=60, total=None)
[   63s] 
[   63s]     def _make_request(
[   63s]         self, conn, method, url, timeout=_Default, chunked=False, **httplib_request_kw
[   63s]     ):
[   63s]         """
[   63s]         Perform a request on a given urllib connection object taken from our
[   63s]         pool.
[   63s]     
[   63s]         :param conn:
[   63s]             a connection from one of our connection pools
[   63s]     
[   63s]         :param timeout:
[   63s]             Socket timeout in seconds for the request. This can be a
[   63s]             float or integer, which will set the same timeout value for
[   63s]             the socket connect and the socket read, or an instance of
[   63s]             :class:`urllib3.util.Timeout`, which gives you more fine-grained
[   63s]             control over your timeouts.
[   63s]         """
[   63s]         self.num_requests += 1
[   63s]     
[   63s]         timeout_obj = self._get_timeout(timeout)
[   63s]         timeout_obj.start_connect()
[   63s]         conn.timeout = timeout_obj.connect_timeout
[   63s]     
[   63s]         # Trigger any extra validation we need to do.
[   63s]         try:
[   63s]             self._validate_conn(conn)
[   63s]         except (SocketTimeout, BaseSSLError) as e:
[   63s]             # Py2 raises this as a BaseSSLError, Py3 raises it as socket timeout.
[   63s]             self._raise_timeout(err=e, url=url, timeout_value=conn.timeout)
[   63s]             raise
[   63s]     
[   63s]         # conn.request() calls http.client.*.request, not the method in
[   63s]         # urllib3.request. It also calls makefile (recv) on the socket.
[   63s]         try:
[   63s]             if chunked:
[   63s]                 conn.request_chunked(method, url, **httplib_request_kw)
[   63s]             else:
[   63s] >               conn.request(method, url, **httplib_request_kw)
[   63s] 
[   63s] /usr/lib/python3.6/site-packages/urllib3/connectionpool.py:394: 
[   63s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   63s] 
[   63s] self = <docker.transport.unixconn.UnixHTTPConnection object at 0x7f8bc80ef358>
[   63s] method = 'GET', url = '/version', body = None
[   63s] headers = {'User-Agent': 'docker-sdk-python/4.4.4', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'}
[   63s] 
[   63s]     def request(self, method, url, body=None, headers={}, *,
[   63s]                 encode_chunked=False):
[   63s]         """Send a complete request to the server."""
[   63s] >       self._send_request(method, url, body, headers, encode_chunked)
[   63s] 
[   63s] /usr/lib64/python3.6/http/client.py:1287: 
[   63s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   63s] 
[   63s] self = <docker.transport.unixconn.UnixHTTPConnection object at 0x7f8bc80ef358>
[   63s] method = 'GET', url = '/version', body = None
[   63s] headers = {'User-Agent': 'docker-sdk-python/4.4.4', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'}
[   63s] encode_chunked = False
[   63s] 
[   63s]     def _send_request(self, method, url, body, headers, encode_chunked):
[   63s]         # Honor explicitly requested Host: and Accept-Encoding: headers.
[   63s]         header_names = frozenset(k.lower() for k in headers)
[   63s]         skips = {}
[   63s]         if 'host' in header_names:
[   63s]             skips['skip_host'] = 1
[   63s]         if 'accept-encoding' in header_names:
[   63s]             skips['skip_accept_encoding'] = 1
[   63s]     
[   63s]         self.putrequest(method, url, **skips)
[   63s]     
[   63s]         # chunked encoding will happen if HTTP/1.1 is used and either
[   63s]         # the caller passes encode_chunked=True or the following
[   63s]         # conditions hold:
[   63s]         # 1. content-length has not been explicitly set
[   63s]         # 2. the body is a file or iterable, but not a str or bytes-like
[   63s]         # 3. Transfer-Encoding has NOT been explicitly set by the caller
[   63s]     
[   63s]         if 'content-length' not in header_names:
[   63s]             # only chunk body if not explicitly set for backwards
[   63s]             # compatibility, assuming the client code is already handling the
[   63s]             # chunking
[   63s]             if 'transfer-encoding' not in header_names:
[   63s]                 # if content-length cannot be automatically determined, fall
[   63s]                 # back to chunked encoding
[   63s]                 encode_chunked = False
[   63s]                 content_length = self._get_content_length(body, method)
[   63s]                 if content_length is None:
[   63s]                     if body is not None:
[   63s]                         if self.debuglevel > 0:
[   63s]                             print('Unable to determine size of %r' % body)
[   63s]                         encode_chunked = True
[   63s]                         self.putheader('Transfer-Encoding', 'chunked')
[   63s]                 else:
[   63s]                     self.putheader('Content-Length', str(content_length))
[   63s]         else:
[   63s]             encode_chunked = False
[   63s]     
[   63s]         for hdr, value in headers.items():
[   63s]             self.putheader(hdr, value)
[   63s]         if isinstance(body, str):
[   63s]             # RFC 2616 Section 3.7.1 says that text default has a
[   63s]             # default charset of iso-8859-1.
[   63s]             body = _encode(body, 'body')
[   63s] >       self.endheaders(body, encode_chunked=encode_chunked)
[   63s] 
[   63s] /usr/lib64/python3.6/http/client.py:1333: 
[   63s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   63s] 
[   63s] self = <docker.transport.unixconn.UnixHTTPConnection object at 0x7f8bc80ef358>
[   63s] message_body = None
[   63s] 
[   63s]     def endheaders(self, message_body=None, *, encode_chunked=False):
[   63s]         """Indicate that the last header line has been sent to the server.
[   63s]     
[   63s]         This method sends the request to the server.  The optional message_body
[   63s]         argument can be used to pass a message body associated with the
[   63s]         request.
[   63s]         """
[   63s]         if self.__state == _CS_REQ_STARTED:
[   63s]             self.__state = _CS_REQ_SENT
[   63s]         else:
[   63s]             raise CannotSendHeader()
[   63s] >       self._send_output(message_body, encode_chunked=encode_chunked)
[   63s] 
[   63s] /usr/lib64/python3.6/http/client.py:1282: 
[   63s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   63s] 
[   63s] self = <docker.transport.unixconn.UnixHTTPConnection object at 0x7f8bc80ef358>
[   63s] message_body = None, encode_chunked = False
[   63s] 
[   63s]     def _send_output(self, message_body=None, encode_chunked=False):
[   63s]         """Send the currently buffered request and clear the buffer.
[   63s]     
[   63s]         Appends an extra \\r\\n to the buffer.
[   63s]         A message_body may be specified, to be appended to the request.
[   63s]         """
[   63s]         self._buffer.extend((b"", b""))
[   63s]         msg = b"\r\n".join(self._buffer)
[   63s]         del self._buffer[:]
[   63s] >       self.send(msg)
[   63s] 
[   63s] /usr/lib64/python3.6/http/client.py:1042: 
[   63s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   63s] 
[   63s] self = <docker.transport.unixconn.UnixHTTPConnection object at 0x7f8bc80ef358>
[   63s] data = b'GET /version HTTP/1.1\r\nHost: localhost\r\nUser-Agent: docker-sdk-python/4.4.4\r\nAccept-Encoding: gzip, deflate\r\nAccept: */*\r\nConnection: keep-alive\r\n\r\n'
[   63s] 
[   63s]     def send(self, data):
[   63s]         """Send `data' to the server.
[   63s]         ``data`` can be a string object, a bytes object, an array object, a
[   63s]         file-like object that supports a .read() method, or an iterable object.
[   63s]         """
[   63s]     
[   63s]         if self.sock is None:
[   63s]             if self.auto_open:
[   63s] >               self.connect()
[   63s] 
[   63s] /usr/lib64/python3.6/http/client.py:980: 
[   63s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   63s] 
[   63s] self = <docker.transport.unixconn.UnixHTTPConnection object at 0x7f8bc80ef358>
[   63s] 
[   63s]     def connect(self):
[   63s]         sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
[   63s]         sock.settimeout(self.timeout)
[   63s] >       sock.connect(self.unix_socket)
[   63s] E       FileNotFoundError: [Errno 2] No such file or directory
[   63s] 
[   63s] /usr/lib/python3.6/site-packages/docker/transport/unixconn.py:43: FileNotFoundError
[   63s] 
[   63s] During handling of the above exception, another exception occurred:
[   63s] 
[   63s] self = <docker.transport.unixconn.UnixHTTPAdapter object at 0x7f8bc80e8f60>
[   63s] request = <PreparedRequest [GET]>, stream = False
[   63s] timeout = Timeout(connect=60, read=60, total=None), verify = True, cert = None
[   63s] proxies = OrderedDict()
[   63s] 
[   63s]     def send(self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None):
[   63s]         """Sends PreparedRequest object. Returns Response object.
[   63s]     
[   63s]         :param request: The :class:`PreparedRequest <PreparedRequest>` being sent.
[   63s]         :param stream: (optional) Whether to stream the request content.
[   63s]         :param timeout: (optional) How long to wait for the server to send
[   63s]             data before giving up, as a float, or a :ref:`(connect timeout,
[   63s]             read timeout) <timeouts>` tuple.
[   63s]         :type timeout: float or tuple or urllib3 Timeout object
[   63s]         :param verify: (optional) Either a boolean, in which case it controls whether
[   63s]             we verify the server's TLS certificate, or a string, in which case it
[   63s]             must be a path to a CA bundle to use
[   63s]         :param cert: (optional) Any user-provided SSL certificate to be trusted.
[   63s]         :param proxies: (optional) The proxies dictionary to apply to the request.
[   63s]         :rtype: requests.Response
[   63s]         """
[   63s]     
[   63s]         try:
[   63s]             conn = self.get_connection(request.url, proxies)
[   63s]         except LocationValueError as e:
[   63s]             raise InvalidURL(e, request=request)
[   63s]     
[   63s]         self.cert_verify(conn, request.url, verify, cert)
[   63s]         url = self.request_url(request, proxies)
[   63s]         self.add_headers(request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies)
[   63s]     
[   63s]         chunked = not (request.body is None or 'Content-Length' in request.headers)
[   63s]     
[   63s]         if isinstance(timeout, tuple):
[   63s]             try:
[   63s]                 connect, read = timeout
[   63s]                 timeout = TimeoutSauce(connect=connect, read=read)
[   63s]             except ValueError as e:
[   63s]                 # this may raise a string formatting error.
[   63s]                 err = ("Invalid timeout {}. Pass a (connect, read) "
[   63s]                        "timeout tuple, or a single float to set "
[   63s]                        "both timeouts to the same value".format(timeout))
[   63s]                 raise ValueError(err)
[   63s]         elif isinstance(timeout, TimeoutSauce):
[   63s]             pass
[   63s]         else:
[   63s]             timeout = TimeoutSauce(connect=timeout, read=timeout)
[   63s]     
[   63s]         try:
[   63s]             if not chunked:
[   63s]                 resp = conn.urlopen(
[   63s]                     method=request.method,
[   63s]                     url=url,
[   63s]                     body=request.body,
[   63s]                     headers=request.headers,
[   63s]                     redirect=False,
[   63s]                     assert_same_host=False,
[   63s]                     preload_content=False,
[   63s]                     decode_content=False,
[   63s]                     retries=self.max_retries,
[   63s] >                   timeout=timeout
[   63s]                 )
[   63s] 
[   63s] /usr/lib/python3.6/site-packages/requests/adapters.py:449: 
[   63s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   63s] 
[   63s] self = <docker.transport.unixconn.UnixHTTPConnectionPool object at 0x7f8bc80e8e48>
[   63s] method = 'GET', url = '/version', body = None
[   63s] headers = {'User-Agent': 'docker-sdk-python/4.4.4', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'}
[   63s] retries = Retry(total=0, connect=None, read=False, redirect=None, status=None)
[   63s] redirect = False, assert_same_host = False
[   63s] timeout = Timeout(connect=60, read=60, total=None), pool_timeout = None
[   63s] release_conn = False, chunked = False, body_pos = None
[   63s] response_kw = {'decode_content': False, 'preload_content': False}
[   63s] parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/version', query=None, fragment=None)
[   63s] destination_scheme = None, conn = None, release_this_conn = True
[   63s] http_tunnel_required = False, err = None, clean_exit = False
[   63s] 
[   63s]     def urlopen(
[   63s]         self,
[   63s]         method,
[   63s]         url,
[   63s]         body=None,
[   63s]         headers=None,
[   63s]         retries=None,
[   63s]         redirect=True,
[   63s]         assert_same_host=True,
[   63s]         timeout=_Default,
[   63s]         pool_timeout=None,
[   63s]         release_conn=None,
[   63s]         chunked=False,
[   63s]         body_pos=None,
[   63s]         **response_kw
[   63s]     ):
[   63s]         """
[   63s]         Get a connection from the pool and perform an HTTP request. This is the
[   63s]         lowest level call for making a request, so you'll need to specify all
[   63s]         the raw details.
[   63s]     
[   63s]         .. note::
[   63s]     
[   63s]            More commonly, it's appropriate to use a convenience method provided
[   63s]            by :class:`.RequestMethods`, such as :meth:`request`.
[   63s]     
[   63s]         .. note::
[   63s]     
[   63s]            `release_conn` will only behave as expected if
[   63s]            `preload_content=False` because we want to make
[   63s]            `preload_content=False` the default behaviour someday soon without
[   63s]            breaking backwards compatibility.
[   63s]     
[   63s]         :param method:
[   63s]             HTTP request method (such as GET, POST, PUT, etc.)
[   63s]     
[   63s]         :param url:
[   63s]             The URL to perform the request on.
[   63s]     
[   63s]         :param body:
[   63s]             Data to send in the request body, either :class:`str`, :class:`bytes`,
[   63s]             an iterable of :class:`str`/:class:`bytes`, or a file-like object.
[   63s]     
[   63s]         :param headers:
[   63s]             Dictionary of custom headers to send, such as User-Agent,
[   63s]             If-None-Match, etc. If None, pool headers are used. If provided,
[   63s]             these headers completely replace any pool-specific headers.
[   63s]     
[   63s]         :param retries:
[   63s]             Configure the number of retries to allow before raising a
[   63s]             :class:`~urllib3.exceptions.MaxRetryError` exception.
[   63s]     
[   63s]             Pass ``None`` to retry until you receive a response. Pass a
[   63s]             :class:`~urllib3.util.retry.Retry` object for fine-grained control
[   63s]             over different types of retries.
[   63s]             Pass an integer number to retry connection errors that many times,
[   63s]             but no other types of errors. Pass zero to never retry.
[   63s]     
[   63s]             If ``False``, then retries are disabled and any exception is raised
[   63s]             immediately. Also, instead of raising a MaxRetryError on redirects,
[   63s]             the redirect response will be returned.
[   63s]     
[   63s]         :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int.
[   63s]     
[   63s]         :param redirect:
[   63s]             If True, automatically handle redirects (status codes 301, 302,
[   63s]             303, 307, 308). Each redirect counts as a retry. Disabling retries
[   63s]             will disable redirect, too.
[   63s]     
[   63s]         :param assert_same_host:
[   63s]             If ``True``, will make sure that the host of the pool requests is
[   63s]             consistent else will raise HostChangedError. When ``False``, you can
[   63s]             use the pool on an HTTP proxy and request foreign hosts.
[   63s]     
[   63s]         :param timeout:
[   63s]             If specified, overrides the default timeout for this one
[   63s]             request. It may be a float (in seconds) or an instance of
[   63s]             :class:`urllib3.util.Timeout`.
[   63s]     
[   63s]         :param pool_timeout:
[   63s]             If set and the pool is set to block=True, then this method will
[   63s]             block for ``pool_timeout`` seconds and raise EmptyPoolError if no
[   63s]             connection is available within the time period.
[   63s]     
[   63s]         :param release_conn:
[   63s]             If False, then the urlopen call will not release the connection
[   63s]             back into the pool once a response is received (but will release if
[   63s]             you read the entire contents of the response such as when
[   63s]             `preload_content=True`). This is useful if you're not preloading
[   63s]             the response's content immediately. You will need to call
[   63s]             ``r.release_conn()`` on the response ``r`` to return the connection
[   63s]             back into the pool. If None, it takes the value of
[   63s]             ``response_kw.get('preload_content', True)``.
[   63s]     
[   63s]         :param chunked:
[   63s]             If True, urllib3 will send the body using chunked transfer
[   63s]             encoding. Otherwise, urllib3 will send the body using the standard
[   63s]             content-length form. Defaults to False.
[   63s]     
[   63s]         :param int body_pos:
[   63s]             Position to seek to in file-like body in the event of a retry or
[   63s]             redirect. Typically this won't need to be set because urllib3 will
[   63s]             auto-populate the value when needed.
[   63s]     
[   63s]         :param \\**response_kw:
[   63s]             Additional parameters are passed to
[   63s]             :meth:`urllib3.response.HTTPResponse.from_httplib`
[   63s]         """
[   63s]     
[   63s]         parsed_url = parse_url(url)
[   63s]         destination_scheme = parsed_url.scheme
[   63s]     
[   63s]         if headers is None:
[   63s]             headers = self.headers
[   63s]     
[   63s]         if not isinstance(retries, Retry):
[   63s]             retries = Retry.from_int(retries, redirect=redirect, default=self.retries)
[   63s]     
[   63s]         if release_conn is None:
[   63s]             release_conn = response_kw.get("preload_content", True)
[   63s]     
[   63s]         # Check host
[   63s]         if assert_same_host and not self.is_same_host(url):
[   63s]             raise HostChangedError(self, url, retries)
[   63s]     
[   63s]         # Ensure that the URL we're connecting to is properly encoded
[   63s]         if url.startswith("/"):
[   63s]             url = six.ensure_str(_encode_target(url))
[   63s]         else:
[   63s]             url = six.ensure_str(parsed_url.url)
[   63s]     
[   63s]         conn = None
[   63s]     
[   63s]         # Track whether `conn` needs to be released before
[   63s]         # returning/raising/recursing. Update this variable if necessary, and
[   63s]         # leave `release_conn` constant throughout the function. That way, if
[   63s]         # the function recurses, the original value of `release_conn` will be
[   63s]         # passed down into the recursive call, and its value will be respected.
[   63s]         #
[   63s]         # See issue #651 [1] for details.
[   63s]         #
[   63s]         # [1] <https://github.com/urllib3/urllib3/issues/651>
[   63s]         release_this_conn = release_conn
[   63s]     
[   63s]         http_tunnel_required = connection_requires_http_tunnel(
[   63s]             self.proxy, self.proxy_config, destination_scheme
[   63s]         )
[   63s]     
[   63s]         # Merge the proxy headers. Only done when not using HTTP CONNECT. We
[   63s]         # have to copy the headers dict so we can safely change it without those
[   63s]         # changes being reflected in anyone else's copy.
[   63s]         if not http_tunnel_required:
[   63s]             headers = headers.copy()
[   63s]             headers.update(self.proxy_headers)
[   63s]     
[   63s]         # Must keep the exception bound to a separate variable or else Python 3
[   63s]         # complains about UnboundLocalError.
[   63s]         err = None
[   63s]     
[   63s]         # Keep track of whether we cleanly exited the except block. This
[   63s]         # ensures we do proper cleanup in finally.
[   63s]         clean_exit = False
[   63s]     
[   63s]         # Rewind body position, if needed. Record current position
[   63s]         # for future rewinds in the event of a redirect/retry.
[   63s]         body_pos = set_file_position(body, body_pos)
[   63s]     
[   63s]         try:
[   63s]             # Request a connection from the queue.
[   63s]             timeout_obj = self._get_timeout(timeout)
[   63s]             conn = self._get_conn(timeout=pool_timeout)
[   63s]     
[   63s]             conn.timeout = timeout_obj.connect_timeout
[   63s]     
[   63s]             is_new_proxy_conn = self.proxy is not None and not getattr(
[   63s]                 conn, "sock", None
[   63s]             )
[   63s]             if is_new_proxy_conn and http_tunnel_required:
[   63s]                 self._prepare_proxy(conn)
[   63s]     
[   63s]             # Make the request on the httplib connection object.
[   63s]             httplib_response = self._make_request(
[   63s]                 conn,
[   63s]                 method,
[   63s]                 url,
[   63s]                 timeout=timeout_obj,
[   63s]                 body=body,
[   63s]                 headers=headers,
[   63s]                 chunked=chunked,
[   63s]             )
[   63s]     
[   63s]             # If we're going to release the connection in ``finally:``, then
[   63s]             # the response doesn't need to know about the connection. Otherwise
[   63s]             # it will also try to release it and we'll have a double-release
[   63s]             # mess.
[   63s]             response_conn = conn if not release_conn else None
[   63s]     
[   63s]             # Pass method to Response for length checking
[   63s]             response_kw["request_method"] = method
[   63s]     
[   63s]             # Import httplib's response into our own wrapper object
[   63s]             response = self.ResponseCls.from_httplib(
[   63s]                 httplib_response,
[   63s]                 pool=self,
[   63s]                 connection=response_conn,
[   63s]                 retries=retries,
[   63s]                 **response_kw
[   63s]             )
[   63s]     
[   63s]             # Everything went great!
[   63s]             clean_exit = True
[   63s]     
[   63s]         except EmptyPoolError:
[   63s]             # Didn't get a connection from the pool, no need to clean up
[   63s]             clean_exit = True
[   63s]             release_this_conn = False
[   63s]             raise
[   63s]     
[   63s]         except (
[   63s]             TimeoutError,
[   63s]             HTTPException,
[   63s]             SocketError,
[   63s]             ProtocolError,
[   63s]             BaseSSLError,
[   63s]             SSLError,
[   63s]             CertificateError,
[   63s]         ) as e:
[   63s]             # Discard the connection for these exceptions. It will be
[   63s]             # replaced during the next _get_conn() call.
[   63s]             clean_exit = False
[   63s]             if isinstance(e, (BaseSSLError, CertificateError)):
[   63s]                 e = SSLError(e)
[   63s]             elif isinstance(e, (SocketError, NewConnectionError)) and self.proxy:
[   63s]                 e = ProxyError("Cannot connect to proxy.", e)
[   63s]             elif isinstance(e, (SocketError, HTTPException)):
[   63s]                 e = ProtocolError("Connection aborted.", e)
[   63s]     
[   63s]             retries = retries.increment(
[   63s] >               method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
[   63s]             )
[   63s] 
[   63s] /usr/lib/python3.6/site-packages/urllib3/connectionpool.py:756: 
[   63s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   63s] 
[   63s] self = Retry(total=0, connect=None, read=False, redirect=None, status=None)
[   63s] method = 'GET', url = '/version', response = None
[   63s] error = ProtocolError('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
[   63s] _pool = <docker.transport.unixconn.UnixHTTPConnectionPool object at 0x7f8bc80e8e48>
[   63s] _stacktrace = <traceback object at 0x7f8bc811b8c8>
[   63s] 
[   63s]     def increment(
[   63s]         self,
[   63s]         method=None,
[   63s]         url=None,
[   63s]         response=None,
[   63s]         error=None,
[   63s]         _pool=None,
[   63s]         _stacktrace=None,
[   63s]     ):
[   63s]         """Return a new Retry object with incremented retry counters.
[   63s]     
[   63s]         :param response: A response object, or None, if the server did not
[   63s]             return a response.
[   63s]         :type response: :class:`~urllib3.response.HTTPResponse`
[   63s]         :param Exception error: An error encountered during the request, or
[   63s]             None if the response was received successfully.
[   63s]     
[   63s]         :return: A new ``Retry`` object.
[   63s]         """
[   63s]         if self.total is False and error:
[   63s]             # Disabled, indicate to re-raise the error.
[   63s]             raise six.reraise(type(error), error, _stacktrace)
[   63s]     
[   63s]         total = self.total
[   63s]         if total is not None:
[   63s]             total -= 1
[   63s]     
[   63s]         connect = self.connect
[   63s]         read = self.read
[   63s]         redirect = self.redirect
[   63s]         status_count = self.status
[   63s]         other = self.other
[   63s]         cause = "unknown"
[   63s]         status = None
[   63s]         redirect_location = None
[   63s]     
[   63s]         if error and self._is_connection_error(error):
[   63s]             # Connect retry?
[   63s]             if connect is False:
[   63s]                 raise six.reraise(type(error), error, _stacktrace)
[   63s]             elif connect is not None:
[   63s]                 connect -= 1
[   63s]     
[   63s]         elif error and self._is_read_error(error):
[   63s]             # Read retry?
[   63s]             if read is False or not self._is_method_retryable(method):
[   63s] >               raise six.reraise(type(error), error, _stacktrace)
[   63s] 
[   63s] /usr/lib/python3.6/site-packages/urllib3/util/retry.py:532: 
[   63s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   63s] 
[   63s] tp = <class 'urllib3.exceptions.ProtocolError'>, value = None, tb = None
[   63s] 
[   63s]     def reraise(tp, value, tb=None):
[   63s]         try:
[   63s]             if value is None:
[   63s]                 value = tp()
[   63s]             if value.__traceback__ is not tb:
[   63s] >               raise value.with_traceback(tb)
[   63s] 
[   63s] /usr/lib/python3.6/site-packages/urllib3/packages/six.py:734: 
[   63s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   63s] 
[   63s] self = <docker.transport.unixconn.UnixHTTPConnectionPool object at 0x7f8bc80e8e48>
[   63s] method = 'GET', url = '/version', body = None
[   63s] headers = {'User-Agent': 'docker-sdk-python/4.4.4', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'}
[   63s] retries = Retry(total=0, connect=None, read=False, redirect=None, status=None)
[   63s] redirect = False, assert_same_host = False
[   63s] timeout = Timeout(connect=60, read=60, total=None), pool_timeout = None
[   63s] release_conn = False, chunked = False, body_pos = None
[   63s] response_kw = {'decode_content': False, 'preload_content': False}
[   63s] parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/version', query=None, fragment=None)
[   63s] destination_scheme = None, conn = None, release_this_conn = True
[   63s] http_tunnel_required = False, err = None, clean_exit = False
[   63s] 
[   63s]     def urlopen(
[   63s]         self,
[   63s]         method,
[   63s]         url,
[   63s]         body=None,
[   63s]         headers=None,
[   63s]         retries=None,
[   63s]         redirect=True,
[   63s]         assert_same_host=True,
[   63s]         timeout=_Default,
[   63s]         pool_timeout=None,
[   63s]         release_conn=None,
[   63s]         chunked=False,
[   63s]         body_pos=None,
[   63s]         **response_kw
[   63s]     ):
[   63s]         """
[   63s]         Get a connection from the pool and perform an HTTP request. This is the
[   63s]         lowest level call for making a request, so you'll need to specify all
[   63s]         the raw details.
[   63s]     
[   63s]         .. note::
[   63s]     
[   63s]            More commonly, it's appropriate to use a convenience method provided
[   63s]            by :class:`.RequestMethods`, such as :meth:`request`.
[   63s]     
[   63s]         .. note::
[   63s]     
[   63s]            `release_conn` will only behave as expected if
[   63s]            `preload_content=False` because we want to make
[   63s]            `preload_content=False` the default behaviour someday soon without
[   63s]            breaking backwards compatibility.
[   63s]     
[   63s]         :param method:
[   63s]             HTTP request method (such as GET, POST, PUT, etc.)
[   63s]     
[   63s]         :param url:
[   63s]             The URL to perform the request on.
[   63s]     
[   63s]         :param body:
[   63s]             Data to send in the request body, either :class:`str`, :class:`bytes`,
[   63s]             an iterable of :class:`str`/:class:`bytes`, or a file-like object.
[   63s]     
[   63s]         :param headers:
[   63s]             Dictionary of custom headers to send, such as User-Agent,
[   63s]             If-None-Match, etc. If None, pool headers are used. If provided,
[   63s]             these headers completely replace any pool-specific headers.
[   63s]     
[   63s]         :param retries:
[   63s]             Configure the number of retries to allow before raising a
[   63s]             :class:`~urllib3.exceptions.MaxRetryError` exception.
[   63s]     
[   63s]             Pass ``None`` to retry until you receive a response. Pass a
[   63s]             :class:`~urllib3.util.retry.Retry` object for fine-grained control
[   63s]             over different types of retries.
[   63s]             Pass an integer number to retry connection errors that many times,
[   63s]             but no other types of errors. Pass zero to never retry.
[   63s]     
[   63s]             If ``False``, then retries are disabled and any exception is raised
[   63s]             immediately. Also, instead of raising a MaxRetryError on redirects,
[   63s]             the redirect response will be returned.
[   63s]     
[   63s]         :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int.
[   63s]     
[   63s]         :param redirect:
[   63s]             If True, automatically handle redirects (status codes 301, 302,
[   63s]             303, 307, 308). Each redirect counts as a retry. Disabling retries
[   63s]             will disable redirect, too.
[   63s]     
[   63s]         :param assert_same_host:
[   63s]             If ``True``, will make sure that the host of the pool requests is
[   63s]             consistent else will raise HostChangedError. When ``False``, you can
[   63s]             use the pool on an HTTP proxy and request foreign hosts.
[   63s]     
[   63s]         :param timeout:
[   63s]             If specified, overrides the default timeout for this one
[   63s]             request. It may be a float (in seconds) or an instance of
[   63s]             :class:`urllib3.util.Timeout`.
[   63s]     
[   63s]         :param pool_timeout:
[   63s]             If set and the pool is set to block=True, then this method will
[   63s]             block for ``pool_timeout`` seconds and raise EmptyPoolError if no
[   63s]             connection is available within the time period.
[   63s]     
[   63s]         :param release_conn:
[   63s]             If False, then the urlopen call will not release the connection
[   63s]             back into the pool once a response is received (but will release if
[   63s]             you read the entire contents of the response such as when
[   63s]             `preload_content=True`). This is useful if you're not preloading
[   63s]             the response's content immediately. You will need to call
[   63s]             ``r.release_conn()`` on the response ``r`` to return the connection
[   63s]             back into the pool. If None, it takes the value of
[   63s]             ``response_kw.get('preload_content', True)``.
[   63s]     
[   63s]         :param chunked:
[   63s]             If True, urllib3 will send the body using chunked transfer
[   63s]             encoding. Otherwise, urllib3 will send the body using the standard
[   63s]             content-length form. Defaults to False.
[   63s]     
[   63s]         :param int body_pos:
[   63s]             Position to seek to in file-like body in the event of a retry or
[   63s]             redirect. Typically this won't need to be set because urllib3 will
[   63s]             auto-populate the value when needed.
[   63s]     
[   63s]         :param \\**response_kw:
[   63s]             Additional parameters are passed to
[   63s]             :meth:`urllib3.response.HTTPResponse.from_httplib`
[   63s]         """
[   63s]     
[   63s]         parsed_url = parse_url(url)
[   63s]         destination_scheme = parsed_url.scheme
[   63s]     
[   63s]         if headers is None:
[   63s]             headers = self.headers
[   63s]     
[   63s]         if not isinstance(retries, Retry):
[   63s]             retries = Retry.from_int(retries, redirect=redirect, default=self.retries)
[   63s]     
[   63s]         if release_conn is None:
[   63s]             release_conn = response_kw.get("preload_content", True)
[   63s]     
[   63s]         # Check host
[   63s]         if assert_same_host and not self.is_same_host(url):
[   63s]             raise HostChangedError(self, url, retries)
[   63s]     
[   63s]         # Ensure that the URL we're connecting to is properly encoded
[   63s]         if url.startswith("/"):
[   63s]             url = six.ensure_str(_encode_target(url))
[   63s]         else:
[   63s]             url = six.ensure_str(parsed_url.url)
[   63s]     
[   63s]         conn = None
[   63s]     
[   63s]         # Track whether `conn` needs to be released before
[   63s]         # returning/raising/recursing. Update this variable if necessary, and
[   63s]         # leave `release_conn` constant throughout the function. That way, if
[   63s]         # the function recurses, the original value of `release_conn` will be
[   63s]         # passed down into the recursive call, and its value will be respected.
[   63s]         #
[   63s]         # See issue #651 [1] for details.
[   63s]         #
[   63s]         # [1] <https://github.com/urllib3/urllib3/issues/651>
[   63s]         release_this_conn = release_conn
[   63s]     
[   63s]         http_tunnel_required = connection_requires_http_tunnel(
[   63s]             self.proxy, self.proxy_config, destination_scheme
[   63s]         )
[   63s]     
[   63s]         # Merge the proxy headers. Only done when not using HTTP CONNECT. We
[   63s]         # have to copy the headers dict so we can safely change it without those
[   63s]         # changes being reflected in anyone else's copy.
[   63s]         if not http_tunnel_required:
[   63s]             headers = headers.copy()
[   63s]             headers.update(self.proxy_headers)
[   63s]     
[   63s]         # Must keep the exception bound to a separate variable or else Python 3
[   63s]         # complains about UnboundLocalError.
[   63s]         err = None
[   63s]     
[   63s]         # Keep track of whether we cleanly exited the except block. This
[   63s]         # ensures we do proper cleanup in finally.
[   63s]         clean_exit = False
[   63s]     
[   63s]         # Rewind body position, if needed. Record current position
[   63s]         # for future rewinds in the event of a redirect/retry.
[   63s]         body_pos = set_file_position(body, body_pos)
[   63s]     
[   63s]         try:
[   63s]             # Request a connection from the queue.
[   63s]             timeout_obj = self._get_timeout(timeout)
[   63s]             conn = self._get_conn(timeout=pool_timeout)
[   63s]     
[   63s]             conn.timeout = timeout_obj.connect_timeout
[   63s]     
[   63s]             is_new_proxy_conn = self.proxy is not None and not getattr(
[   63s]                 conn, "sock", None
[   63s]             )
[   63s]             if is_new_proxy_conn and http_tunnel_required:
[   63s]                 self._prepare_proxy(conn)
[   63s]     
[   63s]             # Make the request on the httplib connection object.
[   63s]             httplib_response = self._make_request(
[   63s]                 conn,
[   63s]                 method,
[   63s]                 url,
[   63s]                 timeout=timeout_obj,
[   63s]                 body=body,
[   63s]                 headers=headers,
[   63s] >               chunked=chunked,
[   63s]             )
[   63s] 
[   63s] /usr/lib/python3.6/site-packages/urllib3/connectionpool.py:706: 
[   63s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   63s] 
[   63s] self = <docker.transport.unixconn.UnixHTTPConnectionPool object at 0x7f8bc80e8e48>
[   63s] conn = <docker.transport.unixconn.UnixHTTPConnection object at 0x7f8bc80ef358>
[   63s] method = 'GET', url = '/version'
[   63s] timeout = Timeout(connect=60, read=60, total=None), chunked = False
[   63s] httplib_request_kw = {'body': None, 'headers': {'User-Agent': 'docker-sdk-python/4.4.4', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'}}
[   63s] timeout_obj = Timeout(connect=60, read=60, total=None)
[   63s] 
[   63s]     def _make_request(
[   63s]         self, conn, method, url, timeout=_Default, chunked=False, **httplib_request_kw
[   63s]     ):
[   63s]         """
[   63s]         Perform a request on a given urllib connection object taken from our
[   63s]         pool.
[   63s]     
[   63s]         :param conn:
[   63s]             a connection from one of our connection pools
[   63s]     
[   63s]         :param timeout:
[   63s]             Socket timeout in seconds for the request. This can be a
[   63s]             float or integer, which will set the same timeout value for
[   63s]             the socket connect and the socket read, or an instance of
[   63s]             :class:`urllib3.util.Timeout`, which gives you more fine-grained
[   63s]             control over your timeouts.
[   63s]         """
[   63s]         self.num_requests += 1
[   63s]     
[   63s]         timeout_obj = self._get_timeout(timeout)
[   63s]         timeout_obj.start_connect()
[   63s]         conn.timeout = timeout_obj.connect_timeout
[   63s]     
[   63s]         # Trigger any extra validation we need to do.
[   63s]         try:
[   63s]             self._validate_conn(conn)
[   63s]         except (SocketTimeout, BaseSSLError) as e:
[   63s]             # Py2 raises this as a BaseSSLError, Py3 raises it as socket timeout.
[   63s]             self._raise_timeout(err=e, url=url, timeout_value=conn.timeout)
[   63s]             raise
[   63s]     
[   63s]         # conn.request() calls http.client.*.request, not the method in
[   63s]         # urllib3.request. It also calls makefile (recv) on the socket.
[   63s]         try:
[   63s]             if chunked:
[   63s]                 conn.request_chunked(method, url, **httplib_request_kw)
[   63s]             else:
[   63s] >               conn.request(method, url, **httplib_request_kw)
[   63s] 
[   63s] /usr/lib/python3.6/site-packages/urllib3/connectionpool.py:394: 
[   63s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   63s] 
[   63s] self = <docker.transport.unixconn.UnixHTTPConnection object at 0x7f8bc80ef358>
[   63s] method = 'GET', url = '/version', body = None
[   63s] headers = {'User-Agent': 'docker-sdk-python/4.4.4', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'}
[   63s] 
[   63s]     def request(self, method, url, body=None, headers={}, *,
[   63s]                 encode_chunked=False):
[   63s]         """Send a complete request to the server."""
[   63s] >       self._send_request(method, url, body, headers, encode_chunked)
[   63s] 
[   63s] /usr/lib64/python3.6/http/client.py:1287: 
[   63s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   63s] 
[   63s] self = <docker.transport.unixconn.UnixHTTPConnection object at 0x7f8bc80ef358>
[   63s] method = 'GET', url = '/version', body = None
[   63s] headers = {'User-Agent': 'docker-sdk-python/4.4.4', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'}
[   63s] encode_chunked = False
[   63s] 
[   63s]     def _send_request(self, method, url, body, headers, encode_chunked):
[   63s]         # Honor explicitly requested Host: and Accept-Encoding: headers.
[   63s]         header_names = frozenset(k.lower() for k in headers)
[   63s]         skips = {}
[   63s]         if 'host' in header_names:
[   63s]             skips['skip_host'] = 1
[   63s]         if 'accept-encoding' in header_names:
[   63s]             skips['skip_accept_encoding'] = 1
[   63s]     
[   63s]         self.putrequest(method, url, **skips)
[   63s]     
[   63s]         # chunked encoding will happen if HTTP/1.1 is used and either
[   63s]         # the caller passes encode_chunked=True or the following
[   63s]         # conditions hold:
[   63s]         # 1. content-length has not been explicitly set
[   63s]         # 2. the body is a file or iterable, but not a str or bytes-like
[   63s]         # 3. Transfer-Encoding has NOT been explicitly set by the caller
[   63s]     
[   63s]         if 'content-length' not in header_names:
[   63s]             # only chunk body if not explicitly set for backwards
[   63s]             # compatibility, assuming the client code is already handling the
[   63s]             # chunking
[   63s]             if 'transfer-encoding' not in header_names:
[   63s]                 # if content-length cannot be automatically determined, fall
[   63s]                 # back to chunked encoding
[   63s]                 encode_chunked = False
[   63s]                 content_length = self._get_content_length(body, method)
[   63s]                 if content_length is None:
[   63s]                     if body is not None:
[   63s]                         if self.debuglevel > 0:
[   63s]                             print('Unable to determine size of %r' % body)
[   63s]                         encode_chunked = True
[   63s]                         self.putheader('Transfer-Encoding', 'chunked')
[   63s]                 else:
[   63s]                     self.putheader('Content-Length', str(content_length))
[   63s]         else:
[   63s]             encode_chunked = False
[   63s]     
[   63s]         for hdr, value in headers.items():
[   63s]             self.putheader(hdr, value)
[   63s]         if isinstance(body, str):
[   63s]             # RFC 2616 Section 3.7.1 says that text default has a
[   63s]             # default charset of iso-8859-1.
[   63s]             body = _encode(body, 'body')
[   63s] >       self.endheaders(body, encode_chunked=encode_chunked)
[   63s] 
[   63s] /usr/lib64/python3.6/http/client.py:1333: 
[   63s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   63s] 
[   63s] self = <docker.transport.unixconn.UnixHTTPConnection object at 0x7f8bc80ef358>
[   63s] message_body = None
[   63s] 
[   63s]     def endheaders(self, message_body=None, *, encode_chunked=False):
[   63s]         """Indicate that the last header line has been sent to the server.
[   63s]     
[   63s]         This method sends the request to the server.  The optional message_body
[   63s]         argument can be used to pass a message body associated with the
[   63s]         request.
[   63s]         """
[   63s]         if self.__state == _CS_REQ_STARTED:
[   63s]             self.__state = _CS_REQ_SENT
[   63s]         else:
[   63s]             raise CannotSendHeader()
[   63s] >       self._send_output(message_body, encode_chunked=encode_chunked)
[   63s] 
[   63s] /usr/lib64/python3.6/http/client.py:1282: 
[   63s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   63s] 
[   63s] self = <docker.transport.unixconn.UnixHTTPConnection object at 0x7f8bc80ef358>
[   63s] message_body = None, encode_chunked = False
[   63s] 
[   63s]     def _send_output(self, message_body=None, encode_chunked=False):
[   63s]         """Send the currently buffered request and clear the buffer.
[   63s]     
[   63s]         Appends an extra \\r\\n to the buffer.
[   63s]         A message_body may be specified, to be appended to the request.
[   63s]         """
[   63s]         self._buffer.extend((b"", b""))
[   63s]         msg = b"\r\n".join(self._buffer)
[   63s]         del self._buffer[:]
[   63s] >       self.send(msg)
[   63s] 
[   63s] /usr/lib64/python3.6/http/client.py:1042: 
[   63s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   63s] 
[   63s] self = <docker.transport.unixconn.UnixHTTPConnection object at 0x7f8bc80ef358>
[   63s] data = b'GET /version HTTP/1.1\r\nHost: localhost\r\nUser-Agent: docker-sdk-python/4.4.4\r\nAccept-Encoding: gzip, deflate\r\nAccept: */*\r\nConnection: keep-alive\r\n\r\n'
[   63s] 
[   63s]     def send(self, data):
[   63s]         """Send `data' to the server.
[   63s]         ``data`` can be a string object, a bytes object, an array object, a
[   63s]         file-like object that supports a .read() method, or an iterable object.
[   63s]         """
[   63s]     
[   63s]         if self.sock is None:
[   63s]             if self.auto_open:
[   63s] >               self.connect()
[   63s] 
[   63s] /usr/lib64/python3.6/http/client.py:980: 
[   63s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   63s] 
[   63s] self = <docker.transport.unixconn.UnixHTTPConnection object at 0x7f8bc80ef358>
[   63s] 
[   63s]     def connect(self):
[   63s]         sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
[   63s]         sock.settimeout(self.timeout)
[   63s] >       sock.connect(self.unix_socket)
[   63s] E       urllib3.exceptions.ProtocolError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
[   63s] 
[   63s] /usr/lib/python3.6/site-packages/docker/transport/unixconn.py:43: ProtocolError
[   63s] 
[   63s] During handling of the above exception, another exception occurred:
[   63s] 
[   63s] self = <docker.api.client.APIClient object at 0x7f8bc80e8c50>
[   63s] 
[   63s]     def _retrieve_server_version(self):
[   63s]         try:
[   63s] >           return self.version(api_version=False)["ApiVersion"]
[   63s] 
[   63s] /usr/lib/python3.6/site-packages/docker/api/client.py:214: 
[   63s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   63s] 
[   63s] self = <docker.api.client.APIClient object at 0x7f8bc80e8c50>
[   63s] api_version = False
[   63s] 
[   63s]     def version(self, api_version=True):
[   63s]         """
[   63s]         Returns version information from the server. Similar to the ``docker
[   63s]         version`` command.
[   63s]     
[   63s]         Returns:
[   63s]             (dict): The server version information
[   63s]     
[   63s]         Raises:
[   63s]             :py:class:`docker.errors.APIError`
[   63s]                 If the server returns an error.
[   63s]         """
[   63s]         url = self._url("/version", versioned_api=api_version)
[   63s] >       return self._result(self._get(url), json=True)
[   63s] 
[   63s] /usr/lib/python3.6/site-packages/docker/api/daemon.py:181: 
[   63s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   63s] 
[   63s] self = <docker.api.client.APIClient object at 0x7f8bc80e8c50>
[   63s] args = ('http+docker://localhost/version',), kwargs = {}
[   63s] 
[   63s]     def inner(self, *args, **kwargs):
[   63s]         if 'HttpHeaders' in self._general_configs:
[   63s]             if not kwargs.get('headers'):
[   63s]                 kwargs['headers'] = self._general_configs['HttpHeaders']
[   63s]             else:
[   63s]                 kwargs['headers'].update(self._general_configs['HttpHeaders'])
[   63s] >       return f(self, *args, **kwargs)
[   63s] 
[   63s] /usr/lib/python3.6/site-packages/docker/utils/decorators.py:46: 
[   63s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   63s] 
[   63s] self = <docker.api.client.APIClient object at 0x7f8bc80e8c50>
[   63s] url = 'http+docker://localhost/version', kwargs = {'timeout': 60}
[   63s] 
[   63s]     @update_headers
[   63s]     def _get(self, url, **kwargs):
[   63s] >       return self.get(url, **self._set_request_timeout(kwargs))
[   63s] 
[   63s] /usr/lib/python3.6/site-packages/docker/api/client.py:237: 
[   63s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   63s] 
[   63s] self = <docker.api.client.APIClient object at 0x7f8bc80e8c50>
[   63s] url = 'http+docker://localhost/version'
[   63s] kwargs = {'allow_redirects': True, 'timeout': 60}
[   63s] 
[   63s]     def get(self, url, **kwargs):
[   63s]         r"""Sends a GET request. Returns :class:`Response` object.
[   63s]     
[   63s]         :param url: URL for the new :class:`Request` object.
[   63s]         :param \*\*kwargs: Optional arguments that ``request`` takes.
[   63s]         :rtype: requests.Response
[   63s]         """
[   63s]     
[   63s]         kwargs.setdefault('allow_redirects', True)
[   63s] >       return self.request('GET', url, **kwargs)
[   63s] 
[   63s] /usr/lib/python3.6/site-packages/requests/sessions.py:555: 
[   63s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   63s] 
[   63s] self = <docker.api.client.APIClient object at 0x7f8bc80e8c50>, method = 'GET'
[   63s] url = 'http+docker://localhost/version', params = None, data = None
[   63s] headers = None, cookies = None, files = None, auth = None, timeout = 60
[   63s] allow_redirects = True, proxies = {}, hooks = None, stream = None, verify = None
[   63s] cert = None, json = None
[   63s] 
[   63s]     def request(self, method, url,
[   63s]             params=None, data=None, headers=None, cookies=None, files=None,
[   63s]             auth=None, timeout=None, allow_redirects=True, proxies=None,
[   63s]             hooks=None, stream=None, verify=None, cert=None, json=None):
[   63s]         """Constructs a :class:`Request <Request>`, prepares it and sends it.
[   63s]         Returns :class:`Response <Response>` object.
[   63s]     
[   63s]         :param method: method for the new :class:`Request` object.
[   63s]         :param url: URL for the new :class:`Request` object.
[   63s]         :param params: (optional) Dictionary or bytes to be sent in the query
[   63s]             string for the :class:`Request`.
[   63s]         :param data: (optional) Dictionary, list of tuples, bytes, or file-like
[   63s]             object to send in the body of the :class:`Request`.
[   63s]         :param json: (optional) json to send in the body of the
[   63s]             :class:`Request`.
[   63s]         :param headers: (optional) Dictionary of HTTP Headers to send with the
[   63s]             :class:`Request`.
[   63s]         :param cookies: (optional) Dict or CookieJar object to send with the
[   63s]             :class:`Request`.
[   63s]         :param files: (optional) Dictionary of ``'filename': file-like-objects``
[   63s]             for multipart encoding upload.
[   63s]         :param auth: (optional) Auth tuple or callable to enable
[   63s]             Basic/Digest/Custom HTTP Auth.
[   63s]         :param timeout: (optional) How long to wait for the server to send
[   63s]             data before giving up, as a float, or a :ref:`(connect timeout,
[   63s]             read timeout) <timeouts>` tuple.
[   63s]         :type timeout: float or tuple
[   63s]         :param allow_redirects: (optional) Set to True by default.
[   63s]         :type allow_redirects: bool
[   63s]         :param proxies: (optional) Dictionary mapping protocol or protocol and
[   63s]             hostname to the URL of the proxy.
[   63s]         :param stream: (optional) whether to immediately download the response
[   63s]             content. Defaults to ``False``.
[   63s]         :param verify: (optional) Either a boolean, in which case it controls whether we verify
[   63s]             the server's TLS certificate, or a string, in which case it must be a path
[   63s]             to a CA bundle to use. Defaults to ``True``. When set to
[   63s]             ``False``, requests will accept any TLS certificate presented by
[   63s]             the server, and will ignore hostname mismatches and/or expired
[   63s]             certificates, which will make your application vulnerable to
[   63s]             man-in-the-middle (MitM) attacks. Setting verify to ``False``
[   63s]             may be useful during local development or testing.
[   63s]         :param cert: (optional) if String, path to ssl client cert file (.pem).
[   63s]             If Tuple, ('cert', 'key') pair.
[   63s]         :rtype: requests.Response
[   63s]         """
[   63s]         # Create the Request.
[   63s]         req = Request(
[   63s]             method=method.upper(),
[   63s]             url=url,
[   63s]             headers=headers,
[   63s]             files=files,
[   63s]             data=data or {},
[   63s]             json=json,
[   63s]             params=params or {},
[   63s]             auth=auth,
[   63s]             cookies=cookies,
[   63s]             hooks=hooks,
[   63s]         )
[   63s]         prep = self.prepare_request(req)
[   63s]     
[   63s]         proxies = proxies or {}
[   63s]     
[   63s]         settings = self.merge_environment_settings(
[   63s]             prep.url, proxies, stream, verify, cert
[   63s]         )
[   63s]     
[   63s]         # Send the request.
[   63s]         send_kwargs = {
[   63s]             'timeout': timeout,
[   63s]             'allow_redirects': allow_redirects,
[   63s]         }
[   63s]         send_kwargs.update(settings)
[   63s] >       resp = self.send(prep, **send_kwargs)
[   63s] 
[   63s] /usr/lib/python3.6/site-packages/requests/sessions.py:542: 
[   63s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   63s] 
[   63s] self = <docker.api.client.APIClient object at 0x7f8bc80e8c50>
[   63s] request = <PreparedRequest [GET]>
[   63s] kwargs = {'cert': None, 'proxies': OrderedDict(), 'stream': False, 'timeout': 60, ...}
[   63s] allow_redirects = True, stream = False, hooks = {'response': []}
[   63s] adapter = <docker.transport.unixconn.UnixHTTPAdapter object at 0x7f8bc80e8f60>
[   63s] start = 1619850087.2075527
[   63s] 
[   63s]     def send(self, request, **kwargs):
[   63s]         """Send a given PreparedRequest.
[   63s]     
[   63s]         :rtype: requests.Response
[   63s]         """
[   63s]         # Set defaults that the hooks can utilize to ensure they always have
[   63s]         # the correct parameters to reproduce the previous request.
[   63s]         kwargs.setdefault('stream', self.stream)
[   63s]         kwargs.setdefault('verify', self.verify)
[   63s]         kwargs.setdefault('cert', self.cert)
[   63s]         kwargs.setdefault('proxies', self.proxies)
[   63s]     
[   63s]         # It's possible that users might accidentally send a Request object.
[   63s]         # Guard against that specific failure case.
[   63s]         if isinstance(request, Request):
[   63s]             raise ValueError('You can only send PreparedRequests.')
[   63s]     
[   63s]         # Set up variables needed for resolve_redirects and dispatching of hooks
[   63s]         allow_redirects = kwargs.pop('allow_redirects', True)
[   63s]         stream = kwargs.get('stream')
[   63s]         hooks = request.hooks
[   63s]     
[   63s]         # Get the appropriate adapter to use
[   63s]         adapter = self.get_adapter(url=request.url)
[   63s]     
[   63s]         # Start time (approximately) of the request
[   63s]         start = preferred_clock()
[   63s]     
[   63s]         # Send the request
[   63s] >       r = adapter.send(request, **kwargs)
[   63s] 
[   63s] /usr/lib/python3.6/site-packages/requests/sessions.py:655: 
[   63s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   63s] 
[   63s] self = <docker.transport.unixconn.UnixHTTPAdapter object at 0x7f8bc80e8f60>
[   63s] request = <PreparedRequest [GET]>, stream = False
[   63s] timeout = Timeout(connect=60, read=60, total=None), verify = True, cert = None
[   63s] proxies = OrderedDict()
[   63s] 
[   63s]     def send(self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None):
[   63s]         """Sends PreparedRequest object. Returns Response object.
[   63s]     
[   63s]         :param request: The :class:`PreparedRequest <PreparedRequest>` being sent.
[   63s]         :param stream: (optional) Whether to stream the request content.
[   63s]         :param timeout: (optional) How long to wait for the server to send
[   63s]             data before giving up, as a float, or a :ref:`(connect timeout,
[   63s]             read timeout) <timeouts>` tuple.
[   63s]         :type timeout: float or tuple or urllib3 Timeout object
[   63s]         :param verify: (optional) Either a boolean, in which case it controls whether
[   63s]             we verify the server's TLS certificate, or a string, in which case it
[   63s]             must be a path to a CA bundle to use
[   63s]         :param cert: (optional) Any user-provided SSL certificate to be trusted.
[   63s]         :param proxies: (optional) The proxies dictionary to apply to the request.
[   63s]         :rtype: requests.Response
[   63s]         """
[   63s]     
[   63s]         try:
[   63s]             conn = self.get_connection(request.url, proxies)
[   63s]         except LocationValueError as e:
[   63s]             raise InvalidURL(e, request=request)
[   63s]     
[   63s]         self.cert_verify(conn, request.url, verify, cert)
[   63s]         url = self.request_url(request, proxies)
[   63s]         self.add_headers(request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies)
[   63s]     
[   63s]         chunked = not (request.body is None or 'Content-Length' in request.headers)
[   63s]     
[   63s]         if isinstance(timeout, tuple):
[   63s]             try:
[   63s]                 connect, read = timeout
[   63s]                 timeout = TimeoutSauce(connect=connect, read=read)
[   63s]             except ValueError as e:
[   63s]                 # this may raise a string formatting error.
[   63s]                 err = ("Invalid timeout {}. Pass a (connect, read) "
[   63s]                        "timeout tuple, or a single float to set "
[   63s]                        "both timeouts to the same value".format(timeout))
[   63s]                 raise ValueError(err)
[   63s]         elif isinstance(timeout, TimeoutSauce):
[   63s]             pass
[   63s]         else:
[   63s]             timeout = TimeoutSauce(connect=timeout, read=timeout)
[   63s]     
[   63s]         try:
[   63s]             if not chunked:
[   63s]                 resp = conn.urlopen(
[   63s]                     method=request.method,
[   63s]                     url=url,
[   63s]                     body=request.body,
[   63s]                     headers=request.headers,
[   63s]                     redirect=False,
[   63s]                     assert_same_host=False,
[   63s]                     preload_content=False,
[   63s]                     decode_content=False,
[   63s]                     retries=self.max_retries,
[   63s]                     timeout=timeout
[   63s]                 )
[   63s]     
[   63s]             # Send the request.
[   63s]             else:
[   63s]                 if hasattr(conn, 'proxy_pool'):
[   63s]                     conn = conn.proxy_pool
[   63s]     
[   63s]                 low_conn = conn._get_conn(timeout=DEFAULT_POOL_TIMEOUT)
[   63s]     
[   63s]                 try:
[   63s]                     low_conn.putrequest(request.method,
[   63s]                                         url,
[   63s]                                         skip_accept_encoding=True)
[   63s]     
[   63s]                     for header, value in request.headers.items():
[   63s]                         low_conn.putheader(header, value)
[   63s]     
[   63s]                     low_conn.endheaders()
[   63s]     
[   63s]                     for i in request.body:
[   63s]                         low_conn.send(hex(len(i))[2:].encode('utf-8'))
[   63s]                         low_conn.send(b'\r\n')
[   63s]                         low_conn.send(i)
[   63s]                         low_conn.send(b'\r\n')
[   63s]                     low_conn.send(b'0\r\n\r\n')
[   63s]     
[   63s]                     # Receive the response from the server
[   63s]                     try:
[   63s]                         # For Python 2.7, use buffering of HTTP responses
[   63s]                         r = low_conn.getresponse(buffering=True)
[   63s]                     except TypeError:
[   63s]                         # For compatibility with Python 3.3+
[   63s]                         r = low_conn.getresponse()
[   63s]     
[   63s]                     resp = HTTPResponse.from_httplib(
[   63s]                         r,
[   63s]                         pool=conn,
[   63s]                         connection=low_conn,
[   63s]                         preload_content=False,
[   63s]                         decode_content=False
[   63s]                     )
[   63s]                 except:
[   63s]                     # If we hit any problems here, clean up the connection.
[   63s]                     # Then, reraise so that we can handle the actual exception.
[   63s]                     low_conn.close()
[   63s]                     raise
[   63s]     
[   63s]         except (ProtocolError, socket.error) as err:
[   63s] >           raise ConnectionError(err, request=request)
[   63s] E           requests.exceptions.ConnectionError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
[   63s] 
[   63s] /usr/lib/python3.6/site-packages/requests/adapters.py:498: ConnectionError
[   63s] 
[   63s] During handling of the above exception, another exception occurred:
[   63s] 
[   63s] mock_init = <MagicMock name='__init__' id='140238333552232'>
[   63s] 
[   63s]     @patch('pytest_server_fixtures.serverclass.docker.ServerClass.__init__')
[   63s]     def test_init(mock_init):
[   63s]         s = DockerServer(sentinel.server_type,
[   63s]                          sentinel.cmd,
[   63s]                          sentinel.get_args,
[   63s]                          sentinel.env,
[   63s] >                        sentinel.image)
[   63s] 
[   63s] tests/unit/serverclass/test_docker_unit.py:11: 
[   63s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   63s] ../../BUILDROOT/python-pytest-server-fixtures-1.7.0-0.x86_64/usr/lib/python3.6/site-packages/pytest_server_fixtures/serverclass/docker.py:38: in __init__
[   63s]     self._client = docker.from_env()
[   63s] /usr/lib/python3.6/site-packages/docker/client.py:101: in from_env
[   63s]     **kwargs_from_env(**kwargs)
[   63s] /usr/lib/python3.6/site-packages/docker/client.py:45: in __init__
[   63s]     self.api = APIClient(*args, **kwargs)
[   63s] /usr/lib/python3.6/site-packages/docker/api/client.py:197: in __init__
[   63s]     self._version = self._retrieve_server_version()
[   63s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   63s] 
[   63s] self = <docker.api.client.APIClient object at 0x7f8bc80e8c50>
[   63s] 
[   63s]     def _retrieve_server_version(self):
[   63s]         try:
[   63s]             return self.version(api_version=False)["ApiVersion"]
[   63s]         except KeyError:
[   63s]             raise DockerException(
[   63s]                 'Invalid response from docker daemon: key "ApiVersion"'
[   63s]                 ' is missing.'
[   63s]             )
[   63s]         except Exception as e:
[   63s]             raise DockerException(
[   63s] >               'Error while fetching server API version: {0}'.format(e)
[   63s]             )
[   63s] E           docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
[   63s] 
[   63s] /usr/lib/python3.6/site-packages/docker/api/client.py:222: DockerException
[   63s] =============================== warnings summary ===============================
[   63s] tests/integration/test_httpd_proxy_server.py::test_start_and_stop
[   63s]   /usr/lib/python3.6/site-packages/path/__init__.py:726: DeprecationWarning: .text is deprecated; use read_text
[   63s]     warnings.warn(".text is deprecated; use read_text", DeprecationWarning)
[   63s] 
[   63s] -- Docs: https://docs.pytest.org/en/stable/warnings.html
[   63s] =========================== short test summary info ============================
[   63s] FAILED tests/unit/serverclass/test_docker_unit.py::test_init - docker.errors....
[   63s] =================== 1 failed, 17 passed, 1 warning in 8.19s ====================
[   63s] Exception ignored in: <bound method Workspace.__del__ of <pytest_server_fixtures.base2.TestServerV2 object at 0x7f8bc80e24a8>>
[   63s] Traceback (most recent call last):
[   63s]   File "/usr/lib/python3.6/site-packages/pytest_shutil/workspace.py", line 77, in __del__
[   63s]     self.teardown()
[   63s]   File "/home/abuild/rpmbuild/BUILDROOT/python-pytest-server-fixtures-1.7.0-0.x86_64/usr/lib/python3.6/site-packages/pytest_server_fixtures/base2.py", line 100, in teardown
[   63s]     super(TestServerV2, self).teardown()
[   63s]   File "/usr/lib/python3.6/site-packages/pytest_shutil/workspace.py", line 139, in teardown
[   63s]     if self.workspace.isdir():
[   63s] AttributeError: 'TestServerV2' object has no attribute 'workspace'
[   63s] error: Bad exit status from /var/tmp/rpm-tmp.GqHacc (%check)

Complete build log with all details of the build and package version used.

eeaston commented 2 years ago

Thanks for raising, this is definitely a bug, a unit test should not be talking to the network.