From b7e66a46aa215ff15bf3349b5d0cf2eee26a0366 Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Mon, 22 Jul 2024 19:39:35 +0300 Subject: [PATCH] handle case that os.cpu_count is zero --- migration_helpers/resources.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration_helpers/resources.py b/migration_helpers/resources.py index ff3e4dff12..747d388860 100644 --- a/migration_helpers/resources.py +++ b/migration_helpers/resources.py @@ -7,7 +7,7 @@ def migrate_resources(resources): if not resources: return { "limits": { - "cpus": CPU_COUNT / 2, + "cpus": (CPU_COUNT or 2) / 2, "memory": f"{TOTAL_MEM / 1024 / 1024}M", } }