From 161f331382f8efd0b58ffc25a54187518548abf2 Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Wed, 28 Feb 2018 11:59:35 -0500 Subject: [PATCH] ceph-volume process always try to expand the executable Signed-off-by: Alfredo Deza --- src/ceph-volume/ceph_volume/process.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/ceph-volume/ceph_volume/process.py b/src/ceph-volume/ceph_volume/process.py index 1a2c268dbd8e0..501c830d99cbc 100644 --- a/src/ceph-volume/ceph_volume/process.py +++ b/src/ceph-volume/ceph_volume/process.py @@ -9,6 +9,15 @@ import logging logger = logging.getLogger(__name__) +def which(executable): + """ + Proxy function to ceph_volume.util.system.which because the ``system`` + module does import ``process`` + """ + from ceph_volume.util import system + return system.which(executable) + + def log_output(descriptor, message, terminal_logging, logfile_logging): """ log output to both the logger and the terminal if terminal_logging is @@ -102,6 +111,8 @@ def run(command, **kw): stop_on_error = kw.pop('stop_on_error', True) command_msg = obfuscate(command, kw.pop('obfuscate', None)) fail_msg = kw.pop('fail_msg', None) + executable = which(command.pop(0)) + command.insert(0, executable) logger.info(command_msg) terminal.write(command_msg) terminal_logging = kw.pop('terminal_logging', True) @@ -166,6 +177,8 @@ def call(command, **kw): terminal_verbose = kw.pop('terminal_verbose', False) logfile_verbose = kw.pop('logfile_verbose', True) show_command = kw.pop('show_command', False) + executable = which(command.pop(0)) + command.insert(0, executable) command_msg = "Running command: %s" % ' '.join(command) stdin = kw.pop('stdin', None) logger.info(command_msg) -- 2.39.5