diff --git a/cli/administration/deploy/dedicated/runner.py b/cli/administration/deploy/dedicated/runner.py index fe858f4854..69df23f4b5 100644 --- a/cli/administration/deploy/dedicated/runner.py +++ b/cli/administration/deploy/dedicated/runner.py @@ -37,12 +37,6 @@ def run_ansible_playbook( start_time = datetime.datetime.now(tz=datetime.UTC) print(f"\n▶️ Script started at: {start_time.isoformat()}\n", flush=True) - if modes.get("MODE_CLEANUP", False): - print("\n🧹 Cleaning up...\n", flush=True) - run_make(repo_root, "clean") - else: - print("\n🧹 Cleanup skipped (MODE_CLEANUP not set or False)\n", flush=True) - if not skip_build: print("\n🛠️ Running project build (make setup)...\n", flush=True) run_make(repo_root, "setup") diff --git a/tests/unit/python/cli/administration/deploy/dedicated/test_runner.py b/tests/unit/python/cli/administration/deploy/dedicated/test_runner.py index 11c8f45ab3..695b6dcd8f 100644 --- a/tests/unit/python/cli/administration/deploy/dedicated/test_runner.py +++ b/tests/unit/python/cli/administration/deploy/dedicated/test_runner.py @@ -89,7 +89,11 @@ class TestRunAnsiblePlaybook(unittest.TestCase): def was_called(cmd: list[str]) -> bool: return any(call_cmd == cmd for call_cmd, _kw in calls) - self.assertTrue(was_called(["make", "clean"]), "Expected 'make clean'") + self.assertFalse( + was_called(["make", "clean"]), + "MODE_CLEANUP tidies the deployed system, so it must not git-clean " + "the control checkout and delete the inventory being deployed", + ) self.assertTrue(was_called(["make", "setup"]), "Expected 'make setup'") for call_cmd, kw in calls: