]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume process the abspath of the executable first 20824/head
authorAlfredo Deza <adeza@redhat.com>
Mon, 12 Mar 2018 20:52:15 +0000 (16:52 -0400)
committerAlfredo Deza <adeza@redhat.com>
Mon, 12 Mar 2018 20:52:15 +0000 (16:52 -0400)
So that it can always log the full path to the executable when it is
logging the 'Running command:' line

Signed-off-by: Alfredo Deza <adeza@redhat.com>
src/ceph-volume/ceph_volume/process.py

index 501c830d99cbceff5c481145d6696b7874eab425..4c2ef55b90be8991502c449a041bf1fdde0410bd 100644 (file)
@@ -108,11 +108,11 @@ def run(command, **kw):
     :param stop_on_error: If a nonzero exit status is return, it raises a ``RuntimeError``
     :param fail_msg: If a nonzero exit status is returned this message will be included in the log
     """
+    executable = which(command.pop(0))
+    command.insert(0, executable)
     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)
@@ -174,11 +174,11 @@ def call(command, **kw):
                              it is forcefully set to True if a return code is non-zero
     :param logfile_verbose: Log stderr/stdout output to log file. Defaults to True
     """
+    executable = which(command.pop(0))
+    command.insert(0, executable)
     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)