mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-07-29 11:55:04 +00:00
Fix typing info. (#1183)
This commit is contained in:
@@ -228,12 +228,12 @@ class Connection(ConnectionBase):
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
) as p:
|
||||
out, err = p.communicate()
|
||||
out = to_text(out, errors="surrogate_or_strict")
|
||||
out_b, err_b = p.communicate()
|
||||
out = to_text(out_b, errors="surrogate_or_strict")
|
||||
|
||||
if p.returncode != 0:
|
||||
display.warning(
|
||||
f"unable to retrieve default user from docker container: {out} {to_text(err)}"
|
||||
f"unable to retrieve default user from docker container: {out} {to_text(err_b)}"
|
||||
)
|
||||
self._container_user_cache[container] = None
|
||||
return None
|
||||
|
||||
@@ -116,9 +116,9 @@ class Connection(ConnectionBase):
|
||||
]
|
||||
|
||||
cmd_parts = nsenter_cmd_parts + [cmd]
|
||||
cmd = to_bytes(" ".join(cmd_parts))
|
||||
cmd_b = to_bytes(" ".join(cmd_parts))
|
||||
|
||||
display.vvv(f"EXEC {to_text(cmd)}", host=self._play_context.remote_addr)
|
||||
display.vvv(f"EXEC {to_text(cmd_b)}", host=self._play_context.remote_addr)
|
||||
display.debug("opening command with Popen()")
|
||||
|
||||
master = None
|
||||
@@ -137,9 +137,9 @@ class Connection(ConnectionBase):
|
||||
display.debug(f"Unable to open pty: {e}")
|
||||
|
||||
with subprocess.Popen(
|
||||
cmd,
|
||||
shell=isinstance(cmd, (str, bytes)),
|
||||
executable=executable if isinstance(cmd, (str, bytes)) else None,
|
||||
cmd_b,
|
||||
shell=True,
|
||||
executable=executable,
|
||||
cwd=self.cwd,
|
||||
stdin=stdin,
|
||||
stdout=subprocess.PIPE,
|
||||
|
||||
Reference in New Issue
Block a user