From 3cec8b6ac9f6b0ba45bcfd05ab7ce046aa932a07 Mon Sep 17 00:00:00 2001 From: Charles Short Date: Fri, 25 Jun 2021 11:57:03 -0400 Subject: [PATCH] Address python3 string issues with subprocess This patch updates our Popen call to enable newlines for calls that we parse or consume the output for. Without universal_newlines=True, the output is treated as bytes under python3 which leads to issues later where we are using it as strings. See https://docs.python.org/3/glossary.html#term-universal-newlines Story: 2006796 Task: 42696 Signed-off-by: Charles Short Change-Id: I9b93907c05486b1f76aebe181af812c243285d6a --- ceph/ceph/files/ceph-manage-journal.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ceph/ceph/files/ceph-manage-journal.py b/ceph/ceph/files/ceph-manage-journal.py index f91cbc166..6bb3b2f58 100644 --- a/ceph/ceph/files/ceph-manage-journal.py +++ b/ceph/ceph/files/ceph-manage-journal.py @@ -25,6 +25,7 @@ def command(arguments, **kwargs): arguments, stdout=subprocess.PIPE, stderr=subprocess.PIPE, + universal_newlines=True, **kwargs) out, err = process.communicate() return out, err, process.returncode