Kaynağa Gözat

Avoids re-extracting `cloudbase-init` if the
destination directory is already present

Signed-off-by: Mihaela Balutoiu <mbalutoiu@cloudbasesolutions.com>

Mihaela Balutoiu 5 ay önce
ebeveyn
işleme
ab63c0f51c
1 değiştirilmiş dosya ile 4 ekleme ve 0 silme
  1. 4 0
      coriolis/osmorphing/windows.py

+ 4 - 0
coriolis/osmorphing/windows.py

@@ -266,6 +266,10 @@ class BaseWindowsMorphingTools(base.BaseOSMorphingTools):
                 else:
                 else:
                     self._conn.exec_ps_command(
                     self._conn.exec_ps_command(
                         "rm -recurse -force %s" % destination)
                         "rm -recurse -force %s" % destination)
+            else:
+                LOG.info("Skipping extraction as destination exists")
+                return
+
         self._conn.exec_ps_command(
         self._conn.exec_ps_command(
             "if(([System.Management.Automation.PSTypeName]"
             "if(([System.Management.Automation.PSTypeName]"
             "'System.IO.Compression.ZipFile').Type -or "
             "'System.IO.Compression.ZipFile').Type -or "