]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume process always try to expand the executable 20650/head
authorAlfredo Deza <adeza@redhat.com>
Wed, 28 Feb 2018 16:59:35 +0000 (11:59 -0500)
committerAlfredo Deza <adeza@redhat.com>
Wed, 28 Feb 2018 20:06:25 +0000 (15:06 -0500)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
src/ceph-volume/ceph_volume/process.py

index 1a2c268dbd8e0426a7cfbcf26bc7892d2c8c1a41..501c830d99cbceff5c481145d6696b7874eab425 100644 (file)
@@ -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)