mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-07-29 11:55:04 +00:00
Address some pylint issues (#1155)
* Address cyclic-import. * Address redefined-builtin. * Address redefined-argument-from-local. * Address many redefined-outer-name. * Address pointless-string-statement. * No longer needed due to separate bugfix. * Address useless-return. * Address possibly-used-before-assignment. * Add TODOs. * Address super-init-not-called. * Address function-redefined. * Address unspecified-encoding. * Clean up more imports.
This commit is contained in:
@@ -425,11 +425,13 @@ class Connection(ConnectionBase):
|
||||
+ to_native(become_output)
|
||||
)
|
||||
|
||||
chunk = None
|
||||
for key, event in events:
|
||||
if key.fileobj == p.stdout:
|
||||
chunk = p.stdout.read()
|
||||
elif key.fileobj == p.stderr:
|
||||
chunk = p.stderr.read()
|
||||
# TODO: avoid chunk being set multiple times!
|
||||
|
||||
if not chunk:
|
||||
stdout, stderr = p.communicate()
|
||||
|
||||
@@ -149,10 +149,10 @@ class Connection(ConnectionBase):
|
||||
transport = "community.docker.docker_api"
|
||||
has_pipelining = True
|
||||
|
||||
def _call_client(self, callable, not_found_can_be_resource=False):
|
||||
def _call_client(self, f, not_found_can_be_resource=False):
|
||||
remote_addr = self.get_option("remote_addr")
|
||||
try:
|
||||
return callable()
|
||||
return f()
|
||||
except NotFound as e:
|
||||
if not_found_can_be_resource:
|
||||
raise AnsibleConnectionFailure(
|
||||
|
||||
@@ -177,11 +177,13 @@ class Connection(ConnectionBase):
|
||||
+ to_native(become_output)
|
||||
)
|
||||
|
||||
chunk = None
|
||||
for key, event in events:
|
||||
if key.fileobj == p.stdout:
|
||||
chunk = p.stdout.read()
|
||||
elif key.fileobj == p.stderr:
|
||||
chunk = p.stderr.read()
|
||||
# TODO: avoid chunk being set multiple times!
|
||||
|
||||
if not chunk:
|
||||
stdout, stderr = p.communicate()
|
||||
|
||||
Reference in New Issue
Block a user