Skip to content

Commit

Permalink
Fix warning/error extraction. (#305)
Browse files Browse the repository at this point in the history
(cherry picked from commit ba5e6f8)
  • Loading branch information
felixfontein authored and patchback[bot] committed Mar 14, 2022
1 parent fbecb24 commit 1b0d2af
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/305-docker_compose-errors-warnings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- "docker_compose - fix Python 3 type error when extracting warnings or errors from docker-compose's output (https://github.com/ansible-collections/community.docker/pull/305)."
4 changes: 2 additions & 2 deletions plugins/modules/docker_compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,8 +586,8 @@ def attempt_extract_errors(exc_str, stdout, stderr):
msg = 'unknown cause'

return {
'warnings': [w.encode('utf-8') for w in warnings],
'errors': [e.encode('utf-8') for e in errors],
'warnings': [to_native(w) for w in warnings],
'errors': [to_native(e) for e in errors],
'msg': msg,
'module_stderr': ''.join(stderr),
'module_stdout': ''.join(stdout)
Expand Down

0 comments on commit 1b0d2af

Please sign in to comment.