From 219c70d7c64bff11635dcfdf08a34ca4a6a13d68 Mon Sep 17 00:00:00 2001 From: Mihaela Balutoiu Date: Fri, 21 Nov 2025 15:55:42 +0200 Subject: [PATCH 1/2] Disable `overwrite` flag when extracting `cloudbase-init` archive to prevent overwriting `local scripts` that were written before the installation. Signed-off-by: Mihaela Balutoiu --- coriolis/osmorphing/windows.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coriolis/osmorphing/windows.py b/coriolis/osmorphing/windows.py index 9f303c5b..eb7d9d37 100644 --- a/coriolis/osmorphing/windows.py +++ b/coriolis/osmorphing/windows.py @@ -512,7 +512,7 @@ def _install_cloudbase_init(self, download_url, self._event_manager.progress_update("Installing cloudbase-init") self._expand_archive(cloudbaseinit_zip_path, - cloudbaseinit_base_dir) + cloudbaseinit_base_dir, overwrite=False) log_dir = "%s\\Log" % cloudbaseinit_base_dir self._conn.exec_ps_command("mkdir '%s' -Force" % log_dir, From 24a44afe0ba833858519acca9fa778c597277b3d Mon Sep 17 00:00:00 2001 From: Mihaela Balutoiu Date: Fri, 21 Nov 2025 16:03:52 +0200 Subject: [PATCH 2/2] Update `unit tests` Signed-off-by: Mihaela Balutoiu --- coriolis/tests/osmorphing/test_windows.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/coriolis/tests/osmorphing/test_windows.py b/coriolis/tests/osmorphing/test_windows.py index a570b8ac..79664a9e 100644 --- a/coriolis/tests/osmorphing/test_windows.py +++ b/coriolis/tests/osmorphing/test_windows.py @@ -551,7 +551,8 @@ def test__install_cloudbase_init( "%sWindows\\System32\\config\\SYSTEM" % self.os_root_dir) mock_expand_archive.assert_called_once_with( - cloudbaseinit_zip_path, cloudbaseinit_base_dir) + cloudbaseinit_zip_path, cloudbaseinit_base_dir, + overwrite=False) self.conn.exec_ps_command.assert_called_once_with( "mkdir '%s' -Force" % @@ -625,7 +626,8 @@ def test_install_cloudbase_init_existing_service( "HKLM\\%s" % mock_uuid4.return_value, "%sWindows\\System32\\config\\SYSTEM" % self.os_root_dir) mock_expand_archive.assert_called_once_with( - cloudbaseinit_zip_path, cloudbaseinit_base_dir) + cloudbaseinit_zip_path, cloudbaseinit_base_dir, + overwrite=False) self.conn.exec_ps_command.assert_called_once_with( "mkdir '%s' -Force" % ("%s\\Log" % cloudbaseinit_base_dir),