瀏覽代碼

Fix read file when ' ' in file name

Cristian Matiut 2 月之前
父節點
當前提交
f897c2a5da
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      coriolis/osmorphing/base.py
  2. 1 1
      coriolis/providers/backup_writers.py

+ 1 - 1
coriolis/osmorphing/base.py

@@ -491,7 +491,7 @@ class BaseLinuxOSMorphingTools(BaseOSMorphingTools):
         if chroot_path.startswith("/") is False:
             chroot_path = "/%s" % chroot_path
         contents = self._exec_cmd_chroot(
-            'cat %s' % chroot_path)
+            'cat "%s"' % chroot_path)
         return contents
 
     def _read_grub_config(self, config):

+ 1 - 1
coriolis/providers/backup_writers.py

@@ -911,7 +911,7 @@ class HTTPBackupWriterBootstrapper(object):
 
     def _read_remote_file_sudo(self, remote_path):
         contents = utils.exec_ssh_cmd(
-            self._ssh, "sudo cat %s" % remote_path, get_pty=True)
+            self._ssh, 'sudo cat "%s"' % remote_path, get_pty=True)
         return contents
 
     def _init_writer(self, ssh, cert_paths):