Просмотр исходного кода

Call sync in _write_file_sudo()

To ensure that the newly written file makes it to disk entirely
a sync is called on the worker.
Gabriel-Adrian Samfira 6 лет назад
Родитель
Сommit
c1c7595936
1 измененных файлов с 2 добавлено и 0 удалено
  1. 2 0
      coriolis/osmorphing/base.py

+ 2 - 0
coriolis/osmorphing/base.py

@@ -144,6 +144,8 @@ class BaseLinuxOSMorphingTools(BaseOSMorphingTools):
         self._write_file(tmp_file, content)
         self._exec_cmd_chroot("cp /%s /%s" % (tmp_file, chroot_path))
         self._exec_cmd_chroot("rm /%s" % tmp_file)
+        utils.exec_ssh_cmd(
+            self._ssh, "sudo sync", self._environment, get_pty=True)
 
     def _enable_systemd_service(self, service_name):
         self._exec_cmd_chroot("systemctl enable %s.service" % service_name)