From 030e68b7396e11e004335fcdb74671292988de76 Mon Sep 17 00:00:00 2001 From: jianxiaoguo <842666271@qq.com> Date: Mon, 29 Aug 2022 15:49:04 +0800 Subject: [PATCH] fix(helmbroker): clean_instance error --- rootfs/helmbroker/cleaner.py | 2 ++ rootfs/helmbroker/utils.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/rootfs/helmbroker/cleaner.py b/rootfs/helmbroker/cleaner.py index 4dffa5a..0b01814 100644 --- a/rootfs/helmbroker/cleaner.py +++ b/rootfs/helmbroker/cleaner.py @@ -13,6 +13,8 @@ def clean_instance(): + if not os.path.exists(INSTANCES_PATH): + return for instance_id in os.listdir(INSTANCES_PATH): if os.path.exists(get_instance_file(instance_id)): data = load_instance_meta(instance_id) diff --git a/rootfs/helmbroker/utils.py b/rootfs/helmbroker/utils.py index 69e59e6..dbbf351 100644 --- a/rootfs/helmbroker/utils.py +++ b/rootfs/helmbroker/utils.py @@ -84,7 +84,7 @@ def load_instance_meta(instance_id): def dump_instance_meta(instance_id, data): - data["last_modified_time "] = time.time() + data["last_modified_time"] = time.time() file = get_instance_file(instance_id) validate(instance=data, schema=INSTANCE_META_SCHEMA) with open(file, "w") as f: @@ -119,7 +119,7 @@ def load_binding_meta(instance_id): def dump_binding_meta(instance_id, data): - data["last_modified_time "] = time.time() + data["last_modified_time"] = time.time() file = os.path.join(get_instance_path(instance_id), "binding.json") validate(instance=data, schema=INSTANCE_META_SCHEMA) with open(file, "w") as f: