소스 검색

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

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

Mihaela Balutoiu 5 달 전
부모
커밋
ab63c0f51c
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      coriolis/osmorphing/windows.py

+ 4 - 0
coriolis/osmorphing/windows.py

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