mirror of https://github.com/docker/docker-py.git
Fix a few pep8 issues
autopep8 --in-place --recursive --experimental -aaa --ignore E309 . Signed-off-by: Ben Firshman <ben@firshman.co.uk>
This commit is contained in:
parent
e676840945
commit
6220636536
|
|
@ -3,4 +3,4 @@ from .version import version, version_info
|
||||||
__version__ = version
|
__version__ = version
|
||||||
__title__ = 'docker-py'
|
__title__ = 'docker-py'
|
||||||
|
|
||||||
from .client import Client, AutoVersionClient, from_env # flake8: noqa
|
from .client import Client, AutoVersionClient, from_env # flake8: noqa
|
||||||
|
|
|
||||||
|
|
@ -5,4 +5,4 @@ from .auth import (
|
||||||
load_config,
|
load_config,
|
||||||
resolve_authconfig,
|
resolve_authconfig,
|
||||||
resolve_repository_name,
|
resolve_repository_name,
|
||||||
) # flake8: noqa
|
) # flake8: noqa
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
from .ssladapter import SSLAdapter # flake8: noqa
|
from .ssladapter import SSLAdapter # flake8: noqa
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ if sys.version_info[0] < 3 or sys.version_info[1] < 5:
|
||||||
|
|
||||||
class SSLAdapter(HTTPAdapter):
|
class SSLAdapter(HTTPAdapter):
|
||||||
'''An HTTPS Transport Adapter that uses an arbitrary SSL version.'''
|
'''An HTTPS Transport Adapter that uses an arbitrary SSL version.'''
|
||||||
|
|
||||||
def __init__(self, ssl_version=None, assert_hostname=None,
|
def __init__(self, ssl_version=None, assert_hostname=None,
|
||||||
assert_fingerprint=None, **kwargs):
|
assert_fingerprint=None, **kwargs):
|
||||||
self.ssl_version = ssl_version
|
self.ssl_version = ssl_version
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ class TLSConfig(object):
|
||||||
)
|
)
|
||||||
|
|
||||||
if not (tls_cert and tls_key) or (not os.path.isfile(tls_cert) or
|
if not (tls_cert and tls_key) or (not os.path.isfile(tls_cert) or
|
||||||
not os.path.isfile(tls_key)):
|
not os.path.isfile(tls_key)):
|
||||||
raise errors.TLSParameterError(
|
raise errors.TLSParameterError(
|
||||||
'Path to a certificate and key files must be provided'
|
'Path to a certificate and key files must be provided'
|
||||||
' through the client_config param'
|
' through the client_config param'
|
||||||
|
|
|
||||||
|
|
@ -3,4 +3,4 @@ from .unixconn import UnixAdapter
|
||||||
try:
|
try:
|
||||||
from .npipeconn import NpipeAdapter
|
from .npipeconn import NpipeAdapter
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ class NpipeSocket(object):
|
||||||
and server-specific methods (bind, listen, accept...) are not
|
and server-specific methods (bind, listen, accept...) are not
|
||||||
implemented.
|
implemented.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, handle=None):
|
def __init__(self, handle=None):
|
||||||
self._timeout = win32pipe.NMPWAIT_USE_DEFAULT_WAIT
|
self._timeout = win32pipe.NMPWAIT_USE_DEFAULT_WAIT
|
||||||
self._handle = handle
|
self._handle = handle
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,11 @@ class SwarmSpec(dict):
|
||||||
self['Orchestration'] = {
|
self['Orchestration'] = {
|
||||||
'TaskHistoryRetentionLimit': task_history_retention_limit
|
'TaskHistoryRetentionLimit': task_history_retention_limit
|
||||||
}
|
}
|
||||||
if any([snapshot_interval, keep_old_snapshots,
|
if any([snapshot_interval,
|
||||||
log_entries_for_slow_followers, heartbeat_tick, election_tick]):
|
keep_old_snapshots,
|
||||||
|
log_entries_for_slow_followers,
|
||||||
|
heartbeat_tick,
|
||||||
|
election_tick]):
|
||||||
self['Raft'] = {
|
self['Raft'] = {
|
||||||
'SnapshotInterval': snapshot_interval,
|
'SnapshotInterval': snapshot_interval,
|
||||||
'KeepOldSnapshots': keep_old_snapshots,
|
'KeepOldSnapshots': keep_old_snapshots,
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
from .ports import (
|
from .ports import (
|
||||||
split_port,
|
split_port,
|
||||||
build_port_bindings
|
build_port_bindings
|
||||||
) # flake8: noqa
|
) # flake8: noqa
|
||||||
|
|
|
||||||
|
|
@ -327,7 +327,7 @@ class DockerApiTest(DockerClientTest):
|
||||||
# mock a stream interface
|
# mock a stream interface
|
||||||
raw_resp = urllib3.HTTPResponse(body=body)
|
raw_resp = urllib3.HTTPResponse(body=body)
|
||||||
setattr(raw_resp._fp, 'chunked', True)
|
setattr(raw_resp._fp, 'chunked', True)
|
||||||
setattr(raw_resp._fp, 'chunk_left', len(body.getvalue())-1)
|
setattr(raw_resp._fp, 'chunk_left', len(body.getvalue()) - 1)
|
||||||
|
|
||||||
# pass `decode=False` to the helper
|
# pass `decode=False` to the helper
|
||||||
raw_resp._fp.seek(0)
|
raw_resp._fp.seek(0)
|
||||||
|
|
|
||||||
|
|
@ -271,9 +271,9 @@ class ImageTest(DockerClientTest):
|
||||||
}
|
}
|
||||||
encoded_auth = auth.encode_header(auth_config)
|
encoded_auth = auth.encode_header(auth_config)
|
||||||
self.client.push(
|
self.client.push(
|
||||||
fake_api.FAKE_IMAGE_NAME, tag=fake_api.FAKE_TAG_NAME,
|
fake_api.FAKE_IMAGE_NAME, tag=fake_api.FAKE_TAG_NAME,
|
||||||
auth_config=auth_config
|
auth_config=auth_config
|
||||||
)
|
)
|
||||||
|
|
||||||
fake_request.assert_called_with(
|
fake_request.assert_called_with(
|
||||||
'POST',
|
'POST',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue