Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix demux handler #320

Merged
merged 1 commit into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions broker/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import yaml

from broker import exceptions, logger as b_log, settings
from broker.binds.containers import demux_output

FilterTest = namedtuple("FilterTest", "haystack needle test")
INVENTORY_LOCK = threading.Lock()
Expand Down Expand Up @@ -574,12 +573,13 @@ def from_ssh(cls, stdout, channel):
def from_duplexed_exec(cls, duplex_exec, runtime=None):
"""Create a Result object from a duplexed exec object from podman or docker."""
if runtime == "podman":
stdout, stderr = demux_output(duplex_exec[1])
status, (stdout, stderr) = duplex_exec
return cls(
status=duplex_exec[0],
status=status,
stdout=stdout.decode("utf-8"),
stderr=stderr.decode("utf-8"),
)

if duplex_exec.output[0]:
stdout = duplex_exec.output[0].decode("utf-8")
else:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ docker = [
"docker",
"paramiko"
]
podman = ["podman"]
podman = ["podman>=5.2"]
setup = [
"build",
"twine",
Expand Down