From a4b7201d6eefd75b8508539d74707315aac6d378 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 23 Oct 2019 14:04:56 -0500 Subject: [PATCH] mgr/ssh: remove stdout/stderr kludges ceph-daemon is now well-behaved with respect to stdout vs stderr. Signed-off-by: Sage Weil --- src/pybind/mgr/ssh/module.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/pybind/mgr/ssh/module.py b/src/pybind/mgr/ssh/module.py index 9303f9e18aa..9f6c0c3e9c8 100644 --- a/src/pybind/mgr/ssh/module.py +++ b/src/pybind/mgr/ssh/module.py @@ -377,10 +377,7 @@ class SSHOrchestrator(MgrModule, orchestrator.Orchestrator): conn, ['/usr/bin/python3', '-u'], stdin=script.encode('utf-8')) - if code: - self.log.debug('code %s, err %s' % (code, err)) - # ceph-daemon combines stdout and stderr, so ignore err. - self.log.debug('code %s out %s' % (code, out)) + self.log.debug('exit code %s out %s err %s' % (code, out, err)) return out, code except Exception as ex: @@ -421,9 +418,7 @@ class SSHOrchestrator(MgrModule, orchestrator.Orchestrator): host, 'osd', 'ceph-volume', ['--', 'inventory', '--format=json']) - # stdout and stderr get combined; assume last line is the real - # output and everything preceding it is an error. - data = json.loads(out[-1]) + data = json.loads(''.join(out)) host_info = orchestrator.OutdatableData(data) self.inventory_cache[host] = host_info else: -- 2.47.3