From d1e8a7d32f7af1cbde227308ce89e0a99901ec87 Mon Sep 17 00:00:00 2001 From: lhhyung Date: Thu, 10 Jul 2025 13:01:30 +0900 Subject: [PATCH] fix: Prevent error when multiple secrets exist with collect_scope=subscription_id --- src/cloudforet/cost_analysis/main.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/cloudforet/cost_analysis/main.py b/src/cloudforet/cost_analysis/main.py index 915ce01..3b1703f 100644 --- a/src/cloudforet/cost_analysis/main.py +++ b/src/cloudforet/cost_analysis/main.py @@ -202,10 +202,8 @@ def __get_secret_data(secret_data: dict, task_options: dict) -> dict: if len(secrets) == 1: return secrets[0] - billing_tenant_id = task_options["billing_tenant_id"] - for _secret_data in secrets: - if _secret_data["tenant_id"] == billing_tenant_id: + if _secret_data["tenant_id"] == task_options.get("billing_tenant_id"): return _secret_data elif _secret_data.get("subscription_id") and _secret_data.get(