Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff docker/__init__.py /Users/cyberax/work/blako/libutils/docker/__init__.py
- 20c20
- < from .client import Client, AutoVersionClient # flake8: noqa
- ---
- > from .client import Client # flake8: noqa
- Only in /Users/cyberax/work/blako/libutils/docker/: __init__.pyc
- Common subdirectories: docker/auth and /Users/cyberax/work/blako/libutils/docker/auth
- diff docker/client.py /Users/cyberax/work/blako/libutils/docker/client.py
- 20c20
- < from datetime import datetime
- ---
- > import warnings
- 23a24
- > from requests.exceptions import Timeout
- 33d33
- <
- 37c37
- < DEFAULT_DOCKER_API_VERSION = '1.18'
- ---
- > DEFAULT_DOCKER_API_VERSION = '1.12'
- 43c43
- < def __init__(self, base_url=None, version=None,
- ---
- > def __init__(self, base_url=None, version=DEFAULT_DOCKER_API_VERSION,
- 54c54,55
- < self.timeout = timeout
- ---
- > self._version = version
- > self._timeout = timeout
- 65,92d65
- < # version detection needs to be after unix adapter mounting
- < if version is None:
- < self._version = DEFAULT_DOCKER_API_VERSION
- < elif isinstance(version, six.string_types):
- < if version.lower() == 'auto':
- < self._version = self._retrieve_server_version()
- < else:
- < self._version = version
- < else:
- < raise errors.DockerException(
- < 'Version parameter must be a string or None. Found {0}'.format(
- < type(version).__name__
- < )
- < )
- <
- < def _retrieve_server_version(self):
- < try:
- < return self.version(api_version=False)["ApiVersion"]
- < except KeyError:
- < raise errors.DockerException(
- < 'Invalid response from docker daemon: key "ApiVersion"'
- < ' is missing.'
- < )
- < except Exception as e:
- < raise errors.DockerException(
- < 'Error while fetching server API version: {0}'.format(e)
- < )
- <
- 96c69
- < kwargs.setdefault('timeout', self.timeout)
- ---
- > kwargs.setdefault('timeout', self._timeout)
- 108,112c81,82
- < def _url(self, path, versioned_api=True):
- < if versioned_api:
- < return '{0}/v{1}{2}'.format(self.base_url, self._version, path)
- < else:
- < return '{0}{1}'.format(self.base_url, path)
- ---
- > def _url(self, path):
- > return '{0}/v{1}{2}'.format(self.base_url, self._version, path)
- 130a101,223
- > def _container_config(self, image, command, hostname=None, user=None,
- > detach=False, stdin_open=False, tty=False,
- > mem_limit=0, ports=None, environment=None, dns=None,
- > volumes=None, volumes_from=None,
- > network_disabled=False, entrypoint=None,
- > cpu_shares=None, working_dir=None, domainname=None,
- > memswap_limit=0):
- > if isinstance(command, six.string_types):
- > command = shlex.split(str(command))
- > if isinstance(environment, dict):
- > environment = [
- > '{0}={1}'.format(k, v) for k, v in environment.items()
- > ]
- >
- > if isinstance(mem_limit, six.string_types):
- > if len(mem_limit) == 0:
- > mem_limit = 0
- > else:
- > units = {'b': 1,
- > 'k': 1024,
- > 'm': 1024 * 1024,
- > 'g': 1024 * 1024 * 1024}
- > suffix = mem_limit[-1].lower()
- >
- > # Check if the variable is a string representation of an int
- > # without a units part. Assuming that the units are bytes.
- > if suffix.isdigit():
- > digits_part = mem_limit
- > suffix = 'b'
- > else:
- > digits_part = mem_limit[:-1]
- >
- > if suffix in units.keys() or suffix.isdigit():
- > try:
- > digits = int(digits_part)
- > except ValueError:
- > message = ('Failed converting the string value for'
- > ' mem_limit ({0}) to a number.')
- > formatted_message = message.format(digits_part)
- > raise errors.DockerException(formatted_message)
- >
- > mem_limit = digits * units[suffix]
- > else:
- > message = ('The specified value for mem_limit parameter'
- > ' ({0}) should specify the units. The postfix'
- > ' should be one of the `b` `k` `m` `g`'
- > ' characters')
- > raise errors.DockerException(message.format(mem_limit))
- >
- > if isinstance(ports, list):
- > exposed_ports = {}
- > for port_definition in ports:
- > port = port_definition
- > proto = 'tcp'
- > if isinstance(port_definition, tuple):
- > if len(port_definition) == 2:
- > proto = port_definition[1]
- > port = port_definition[0]
- > exposed_ports['{0}/{1}'.format(port, proto)] = {}
- > ports = exposed_ports
- >
- > if isinstance(volumes, six.string_types):
- > volumes = [volumes, ]
- >
- > if isinstance(volumes, list):
- > volumes_dict = {}
- > for vol in volumes:
- > volumes_dict[vol] = {}
- > volumes = volumes_dict
- >
- > if volumes_from:
- > if not isinstance(volumes_from, six.string_types):
- > volumes_from = ','.join(volumes_from)
- > else:
- > # Force None, an empty list or dict causes client.start to fail
- > volumes_from = None
- >
- > attach_stdin = False
- > attach_stdout = False
- > attach_stderr = False
- > stdin_once = False
- >
- > if not detach:
- > attach_stdout = True
- > attach_stderr = True
- >
- > if stdin_open:
- > attach_stdin = True
- > stdin_once = True
- >
- > if utils.compare_version('1.10', self._version) >= 0:
- > message = ('{0!r} parameter has no effect on create_container().'
- > ' It has been moved to start()')
- > if dns is not None:
- > raise errors.DockerException(message.format('dns'))
- > if volumes_from is not None:
- > raise errors.DockerException(message.format('volumes_from'))
- >
- > return {
- > 'Hostname': hostname,
- > 'Domainname': domainname,
- > 'ExposedPorts': ports,
- > 'User': user,
- > 'Tty': tty,
- > 'OpenStdin': stdin_open,
- > 'StdinOnce': stdin_once,
- > 'Memory': mem_limit,
- > 'AttachStdin': attach_stdin,
- > 'AttachStdout': attach_stdout,
- > 'AttachStderr': attach_stderr,
- > 'Env': environment,
- > 'Cmd': command,
- > 'Dns': dns,
- > 'Image': image,
- > 'Volumes': volumes,
- > 'VolumesFrom': volumes_from,
- > 'NetworkDisabled': network_disabled,
- > 'Entrypoint': entrypoint,
- > 'CpuShares': cpu_shares,
- > 'WorkingDir': working_dir,
- > 'MemorySwap': memswap_limit
- > }
- >
- 169c262
- < sock = response.raw._fp.fp.raw
- ---
- > return response.raw._fp.fp.raw._sock
- 171,180c264
- < sock = response.raw._fp.fp._sock
- < try:
- < # Keep a reference to the response to stop it being garbage
- < # collected. If the response is garbage collected, it will
- < # close TLS sockets.
- < sock._response = response
- < except AttributeError:
- < # UNIX sockets can't have attributes set on them, but that's
- < # fine because we won't be doing TLS over them
- < pass
- ---
- > return response.raw._fp.fp._sock
- 182,184c266
- < return sock
- <
- < def _stream_helper(self, response, decode=False):
- ---
- > def _stream_helper(self, response):
- 186,203c268,284
- < if response.raw._fp.chunked:
- < reader = response.raw
- < while not reader.closed:
- < # this read call will block until we get a chunk
- < data = reader.read(1)
- < if not data:
- < break
- < if reader._fp.chunk_left:
- < data += reader.read(reader._fp.chunk_left)
- < if decode:
- < if six.PY3:
- < data = data.decode('utf-8')
- < data = json.loads(data)
- < yield data
- < else:
- < # Response isn't chunked, meaning we probably
- < # encountered an error immediately
- < yield self._result(response)
- ---
- > socket_fp = self._get_raw_response_socket(response)
- > socket_fp.setblocking(1)
- > socket = socket_fp.makefile()
- > while True:
- > # Because Docker introduced newlines at the end of chunks in v0.9,
- > # and only on some API endpoints, we have to cater for both cases.
- > size_line = socket.readline()
- > if size_line == '\r\n' or size_line == '\n':
- > size_line = socket.readline()
- >
- > size = int(size_line, 16)
- > if size <= 0:
- > break
- > data = socket.readline()
- > if not data:
- > break
- > yield data
- 219c300
- < def _multiplexed_response_stream_helper(self, response):
- ---
- > def _multiplexed_socket_stream_helper(self, response):
- 221,224c302
- < stream."""
- <
- < # Disable timeout on the underlying socket to prevent
- < # Read timed out(s) for long running processes
- ---
- > socket."""
- 226,229c304,317
- < if six.PY3:
- < socket._sock.settimeout(None)
- < else:
- < socket.settimeout(None)
- ---
- >
- > def recvall(socket, size):
- > blocks = []
- > while size > 0:
- > block = socket.recv(size)
- > if not block:
- > return None
- >
- > blocks.append(block)
- > size -= len(block)
- >
- > sep = bytes() if six.PY3 else str()
- > data = sep.join(blocks)
- > return data
- 232c320,321
- < header = response.raw.read(STREAM_HEADER_SIZE_BYTES)
- ---
- > socket.settimeout(None)
- > header = recvall(socket, STREAM_HEADER_SIZE_BYTES)
- 238c327
- < data = response.raw.read(length)
- ---
- > data = recvall(socket, length)
- 243,246d331
- < @property
- < def api_version(self):
- < return self._version
- <
- 276,281c361,362
- < if stream:
- < return self._multiplexed_response_stream_helper(response)
- < else:
- < return sep.join(
- < [x for x in self._multiplexed_buffer_helper(response)]
- < )
- ---
- > return stream and self._multiplexed_socket_stream_helper(response) or \
- > sep.join([x for x in self._multiplexed_buffer_helper(response)])
- 303,304c384
- < custom_context=False, encoding=None, pull=True,
- < forcerm=False, dockerfile=None):
- ---
- > custom_context=False, encoding=None):
- 318,319d397
- < elif not os.path.isdir(path):
- < raise TypeError("You must specify a directory to build in path")
- 325,331c403
- < exclude = list(filter(bool, f.read().splitlines()))
- < # These are handled by the docker daemon and should not be
- < # excluded on the client
- < if 'Dockerfile' in exclude:
- < exclude.remove('Dockerfile')
- < if '.dockerignore' in exclude:
- < exclude.remove(".dockerignore")
- ---
- > exclude = list(filter(bool, f.read().split('\n')))
- 337,341d408
- < if dockerfile and utils.compare_version('1.17', self._version) < 0:
- < raise errors.InvalidVersion(
- < 'dockerfile was only introduced in API version 1.17'
- < )
- <
- 348,351c415
- < 'rm': rm,
- < 'forcerm': forcerm,
- < 'pull': pull,
- < 'dockerfile': dockerfile
- ---
- > 'rm': rm
- 368,369d431
- < if headers is None:
- < headers = {}
- 383c445
- < if context is not None and not custom_context:
- ---
- > if context is not None:
- 410,411c472
- < since=None, before=None, limit=-1, size=False,
- < filters=None):
- ---
- > since=None, before=None, limit=-1, size=False):
- 420,421d480
- < if filters:
- < params['filters'] = utils.convert_filters(filters)
- 446,447c505
- < memswap_limit=0, cpuset=None, host_config=None,
- < mac_address=None, labels=None):
- ---
- > memswap_limit=0):
- 452,461c510,513
- < if host_config and utils.compare_version('1.15', self._version) < 0:
- < raise errors.InvalidVersion(
- < 'host_config is not supported in API < 1.15'
- < )
- <
- < config = utils.create_container_config(
- < self._version, image, command, hostname, user, detach, stdin_open,
- < tty, mem_limit, ports, environment, dns, volumes, volumes_from,
- < network_disabled, entrypoint, cpu_shares, working_dir, domainname,
- < memswap_limit, cpuset, host_config, mac_address, labels
- ---
- > config = self._container_config(
- > image, command, hostname, user, detach, stdin_open, tty, mem_limit,
- > ports, environment, dns, volumes, volumes_from, network_disabled,
- > entrypoint, cpu_shares, working_dir, domainname, memswap_limit
- 479,539c531,532
- < def events(self, since=None, until=None, filters=None, decode=None):
- < if isinstance(since, datetime):
- < since = utils.datetime_to_timestamp(since)
- <
- < if isinstance(until, datetime):
- < until = utils.datetime_to_timestamp(until)
- <
- < if filters:
- < filters = utils.convert_filters(filters)
- <
- < params = {
- < 'since': since,
- < 'until': until,
- < 'filters': filters
- < }
- <
- < return self._stream_helper(self.get(self._url('/events'),
- < params=params, stream=True),
- < decode=decode)
- <
- < def execute(self, container, cmd, detach=False, stdout=True, stderr=True,
- < stream=False, tty=False):
- < if utils.compare_version('1.15', self._version) < 0:
- < raise errors.InvalidVersion('Exec is not supported in API < 1.15')
- < if isinstance(container, dict):
- < container = container.get('Id')
- < if isinstance(cmd, six.string_types):
- < cmd = shlex.split(str(cmd))
- <
- < data = {
- < 'Container': container,
- < 'User': '',
- < 'Privileged': False,
- < 'Tty': tty,
- < 'AttachStdin': False,
- < 'AttachStdout': stdout,
- < 'AttachStderr': stderr,
- < 'Detach': detach,
- < 'Cmd': cmd
- < }
- <
- < # create the command
- < url = self._url('/containers/{0}/exec'.format(container))
- < res = self._post_json(url, data=data)
- < self._raise_for_status(res)
- <
- < # start the command
- < cmd_id = res.json().get('Id')
- < res = self._post_json(self._url('/exec/{0}/start'.format(cmd_id)),
- < data=data, stream=stream)
- < self._raise_for_status(res)
- < if stream:
- < return self._multiplexed_response_stream_helper(res)
- < elif six.PY3:
- < return bytes().join(
- < [x for x in self._multiplexed_buffer_helper(res)]
- < )
- < else:
- < return str().join(
- < [x for x in self._multiplexed_buffer_helper(res)]
- < )
- ---
- > def events(self):
- > return self._stream_helper(self.get(self._url('/events'), stream=True))
- 557c550,551
- < return self._result(res, True)
- ---
- > self._raise_for_status(res)
- > return self._result(res)
- 559,560c553
- < def images(self, name=None, quiet=False, all=False, viz=False,
- < filters=None):
- ---
- > def images(self, name=None, quiet=False, all=False, viz=False):
- 570,571d562
- < if filters:
- < params['filters'] = utils.convert_filters(filters)
- 652c643
- < reauth=False, insecure_registry=False, dockercfg_path=None):
- ---
- > reauth=False):
- 655,659c646
- < # If dockercfg_path is passed check to see if the config file exists,
- < # if so load that config.
- < if dockercfg_path and os.path.exists(dockercfg_path):
- < self._auth_configs = auth.load_config(dockercfg_path)
- < elif not self._auth_configs:
- ---
- > if not self._auth_configs:
- 684c671
- < timestamps=False, tail='all'):
- ---
- > timestamps=False):
- 691,696c678
- < 'follow': stream and 1 or 0,
- < }
- < if utils.compare_version('1.13', self._version) >= 0:
- < if tail != 'all' and (not isinstance(tail, int) or tail <= 0):
- < tail = 'all'
- < params['tail'] = tail
- ---
- > 'follow': stream and 1 or 0}
- 700c682
- < return self._multiplexed_response_stream_helper(res)
- ---
- > return self._multiplexed_socket_stream_helper(res)
- 717,723d698
- < def pause(self, container):
- < if isinstance(container, dict):
- < container = container.get('Id')
- < url = self._url('/containers/{0}/pause'.format(container))
- < res = self._post(url)
- < self._raise_for_status(res)
- <
- 736,742c711
- < # Port settings is None when the container is running with
- < # network_mode=host.
- < port_settings = json_.get('NetworkSettings', {}).get('Ports')
- < if port_settings is None:
- < return None
- <
- < h_ports = port_settings.get(s_port + '/udp')
- ---
- > h_ports = json_['NetworkSettings']['Ports'].get(s_port + '/udp')
- 744c713
- < h_ports = port_settings.get(s_port + '/tcp')
- ---
- > h_ports = json_['NetworkSettings']['Ports'].get(s_port + '/tcp')
- 828,829d796
- < if isinstance(image, dict):
- < image = image.get('Id')
- 834,854d800
- < def rename(self, container, name):
- < if utils.compare_version('1.17', self._version) < 0:
- < raise errors.InvalidVersion(
- < 'rename was only introduced in API version 1.17'
- < )
- < if isinstance(container, dict):
- < container = container.get('Id')
- < url = self._url("/containers/{0}/rename".format(container))
- < params = {'name': name}
- < res = self._post(url, params=params)
- < self._raise_for_status(res)
- <
- < def resize(self, container, height, width):
- < if isinstance(container, dict):
- < container = container.get('Id')
- <
- < params = {'h': height, 'w': width}
- < url = self._url("/containers/{0}/resize".format(container))
- < res = self._post(url, params=params)
- < self._raise_for_status(res)
- <
- 871,873c817,846
- < restart_policy=None, cap_add=None, cap_drop=None, devices=None,
- < extra_hosts=None, read_only=None, pid_mode=None,
- < security_opt=None):
- ---
- > restart_policy=None, cap_add=None, cap_drop=None):
- > if isinstance(container, dict):
- > container = container.get('Id')
- >
- > if isinstance(lxc_conf, dict):
- > formatted = []
- > for k, v in six.iteritems(lxc_conf):
- > formatted.append({'Key': k, 'Value': str(v)})
- > lxc_conf = formatted
- >
- > start_config = {
- > 'LxcConf': lxc_conf
- > }
- > if binds:
- > start_config['Binds'] = utils.convert_volume_binds(binds)
- >
- > if port_bindings:
- > start_config['PortBindings'] = utils.convert_port_bindings(
- > port_bindings
- > )
- >
- > start_config['PublishAllPorts'] = publish_all_ports
- >
- > if links:
- > if isinstance(links, dict):
- > links = six.iteritems(links)
- >
- > formatted_links = [
- > '{0}:{1}'.format(k, v) for k, v in sorted(links)
- > ]
- 875c848,852
- < if utils.compare_version('1.10', self._version) < 0:
- ---
- > start_config['Links'] = formatted_links
- >
- > start_config['Privileged'] = privileged
- >
- > if utils.compare_version('1.10', self._version) >= 0:
- 877,879c854
- < raise errors.InvalidVersion(
- < 'dns is only supported for API version >= 1.10'
- < )
- ---
- > start_config['Dns'] = dns
- 881,883c856,862
- < raise errors.InvalidVersion(
- < 'volumes_from is only supported for API version >= 1.10'
- < )
- ---
- > if isinstance(volumes_from, six.string_types):
- > volumes_from = volumes_from.split(',')
- > start_config['VolumesFrom'] = volumes_from
- > else:
- > warning_message = ('{0!r} parameter is discarded. It is only'
- > ' available for API version greater or equal'
- > ' than 1.10')
- 885,889c864,874
- < if utils.compare_version('1.15', self._version) < 0:
- < if security_opt is not None:
- < raise errors.InvalidVersion(
- < 'security_opt is only supported for API version >= 1.15'
- < )
- ---
- > if dns is not None:
- > warnings.warn(warning_message.format('dns'),
- > DeprecationWarning)
- > if volumes_from is not None:
- > warnings.warn(warning_message.format('volumes_from'),
- > DeprecationWarning)
- > if dns_search:
- > start_config['DnsSearch'] = dns_search
- >
- > if network_mode:
- > start_config['NetworkMode'] = network_mode
- 891,899c876,877
- < if utils.compare_version('1.17', self._version) < 0:
- < if read_only is not None:
- < raise errors.InvalidVersion(
- < 'read_only is only supported for API version >= 1.17'
- < )
- < if pid_mode is not None:
- < raise errors.InvalidVersion(
- < 'pid_mode is only supported for API version >= 1.17'
- < )
- ---
- > if restart_policy:
- > start_config['RestartPolicy'] = restart_policy
- 901,909c879,880
- < start_config = utils.create_host_config(
- < binds=binds, port_bindings=port_bindings, lxc_conf=lxc_conf,
- < publish_all_ports=publish_all_ports, links=links, dns=dns,
- < privileged=privileged, dns_search=dns_search, cap_add=cap_add,
- < cap_drop=cap_drop, volumes_from=volumes_from, devices=devices,
- < network_mode=network_mode, restart_policy=restart_policy,
- < extra_hosts=extra_hosts, read_only=read_only, pid_mode=pid_mode,
- < security_opt=security_opt
- < )
- ---
- > if cap_add:
- > start_config['CapAdd'] = cap_add
- 911,912c882,883
- < if isinstance(container, dict):
- < container = container.get('Id')
- ---
- > if cap_drop:
- > start_config['CapDrop'] = cap_drop
- 915,916d885
- < if not start_config:
- < start_config = None
- 920,924c889
- < def stats(self, container, decode=None):
- < if utils.compare_version('1.17', self._version) < 0:
- < raise errors.InvalidVersion(
- < 'Stats retrieval is not supported in API < 1.17!')
- <
- ---
- > def resize(self, container, height, width):
- 927,928c892,896
- < url = self._url("/containers/{0}/stats".format(container))
- < return self._stream_helper(self._get(url, stream=True), decode=decode)
- ---
- >
- > params = {'h': height, 'w': width}
- > url = self._url("/containers/{0}/resize".format(container))
- > res = self._post(url, params=params)
- > self._raise_for_status(res)
- 935d902
- <
- 937c904
- < timeout=(timeout + self.timeout))
- ---
- > timeout=(timeout + self._timeout))
- 955,964c922,923
- < def version(self, api_version=True):
- < url = self._url("/version", versioned_api=api_version)
- < return self._result(self._get(url), json=True)
- <
- < def unpause(self, container):
- < if isinstance(container, dict):
- < container = container.get('Id')
- < url = self._url('/containers/{0}/unpause'.format(container))
- < res = self._post(url)
- < self._raise_for_status(res)
- ---
- > def version(self):
- > return self._result(self._get(self._url("/version")), True)
- 966c925
- < def wait(self, container, timeout=None):
- ---
- > def wait(self, container):
- 970c929
- < res = self._post(url, timeout=timeout)
- ---
- > res = self._post(url, timeout=None)
- 976a936,945
- > def get_json_stats(self, container):
- > if isinstance(container, dict):
- > container = container.get('Id')
- > url = self._url("/containers/{0}/json".format(container))
- > res = self._get(url, timeout=None)
- > if res.status_code == 404:
- > return None
- > self._raise_for_status(res)
- > json_ = res.json()
- > return json_
- 978,985c947,972
- < class AutoVersionClient(Client):
- < def __init__(self, *args, **kwargs):
- < if 'version' in kwargs and kwargs['version']:
- < raise errors.DockerException(
- < 'Can not specify version for AutoVersionClient'
- < )
- < kwargs['version'] = 'auto'
- < super(AutoVersionClient, self).__init__(*args, **kwargs)
- ---
- > def pid(self, container):
- > json_ = self.get_json_stats(container)
- > return json_['State']['Pid']
- >
- > def poll(self, container):
- > json_ = self.get_json_stats(container)
- > if json_['State']['Running']:
- > return None
- >
- > return self.wait(container)
- >
- > def stats(self, container):
- > if isinstance(container, dict):
- > container = container.get('Id')
- > url = self._url("/containers/{0}/stats".format(container))
- > try:
- > res = self._get(url, stream=True, timeout=5)
- > except Timeout:
- > return None
- > if res.status_code == 404:
- > return None
- > self._raise_for_status(res)
- >
- > # Yes, it doesn't loop. We just need the first line.
- > for ln in res.iter_lines(decode_unicode=False):
- > return json.loads(ln)
- Only in /Users/cyberax/work/blako/libutils/docker/: client.pyc
- diff docker/errors.py /Users/cyberax/work/blako/libutils/docker/errors.py
- 33c33
- < message = '{0} Client Error: {1}'.format(
- ---
- > message = '%s Client Error: %s' % (
- 37c37
- < message = '{0} Server Error: {1}'.format(
- ---
- > message = '%s Server Error: %s' % (
- 41c41
- < message = '{0} ("{1}")'.format(message, self.explanation)
- ---
- > message = '%s ("%s")' % (message, self.explanation)
- 56,59d55
- < class InvalidVersion(DockerException):
- < pass
- <
- <
- Only in /Users/cyberax/work/blako/libutils/docker/: errors.pyc
- Common subdirectories: docker/ssladapter and /Users/cyberax/work/blako/libutils/docker/ssladapter
- diff docker/tls.py /Users/cyberax/work/blako/libutils/docker/tls.py
- 13c13
- < ssl_version=None, assert_hostname=None):
- ---
- > ssl_version=None):
- 20,24c20,21
- < # urllib3 sets a default ssl_version if ssl_version is None,
- < # but that default is the vulnerable PROTOCOL_SSLv23 selection,
- < # so we override the default with the maximum supported in the running
- < # Python interpeter up to TLS 1.2. (see: http://tinyurl.com/kxga8hb)
- < ssl_version = ssl_version or ssladapter.get_max_tls_protocol()
- ---
- > # urllib3 sets a default ssl_version if ssl_version is None
- > # http://tinyurl.com/kxga8hb
- 26d22
- < self.assert_hostname = assert_hostname
- 72,75c68
- < client.mount('https://', ssladapter.SSLAdapter(
- < ssl_version=self.ssl_version,
- < assert_hostname=self.assert_hostname,
- < ))
- ---
- > client.mount('https://', ssladapter.SSLAdapter(self.ssl_version))
- Only in /Users/cyberax/work/blako/libutils/docker/: tls.pyc
- Common subdirectories: docker/unixconn and /Users/cyberax/work/blako/libutils/docker/unixconn
- Common subdirectories: docker/utils and /Users/cyberax/work/blako/libutils/docker/utils
- diff docker/version.py /Users/cyberax/work/blako/libutils/docker/version.py
- 1c1
- < version = "1.1.1-dev"
- ---
- > version = "0.5.0"
Add Comment
Please, Sign In to add comment