]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/ssh: remove stdout/stderr kludges
authorSage Weil <sage@redhat.com>
Wed, 23 Oct 2019 19:04:56 +0000 (14:04 -0500)
committerSage Weil <sage@redhat.com>
Wed, 23 Oct 2019 19:45:34 +0000 (14:45 -0500)
ceph-daemon is now well-behaved with respect to stdout vs stderr.

Signed-off-by: Sage Weil <sage@redhat.com>
src/pybind/mgr/ssh/module.py

index 9303f9e18aa623f0c3ec7780c3bfb07bb404b0b2..9f6c0c3e9c8c1627890e011f9f915f89de743cd5 100644 (file)
@@ -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: