From 123eb325767690e21b64d3e2527105f932ee62c2 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 1 Oct 2019 10:30:42 -0500 Subject: [PATCH] mgr/ssh: run c-v with podman when getting inventory Signed-off-by: Sage Weil --- src/pybind/mgr/ssh/module.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/pybind/mgr/ssh/module.py b/src/pybind/mgr/ssh/module.py index 8daa28da4c4da..87e740a741d59 100644 --- a/src/pybind/mgr/ssh/module.py +++ b/src/pybind/mgr/ssh/module.py @@ -439,15 +439,24 @@ class SSHOrchestrator(MgrModule, orchestrator.Orchestrator): conn = self._get_connection(host) try: - ceph_volume_executable = self._executable_path(conn, 'ceph-volume') + ceph_volume_executable = self._executable_path(conn, 'podman') command = [ ceph_volume_executable, + 'run', + '-it', + '--net=host', + '--privileged', + '--entrypoint', + '/usr/sbin/ceph-volume', + 'ceph/daemon-base', "inventory", "--format=json" ] out, err, code = remoto.process.check(conn, command) - host_devices = json.loads(out[0]) + # stdout and stderr get combined; assume last line is the real + # output and everything preceding it is an error. + host_devices = json.loads(out[-1]) return host_devices except Exception as ex: -- 2.39.5