From 7f1c863a8ecb026a66e41f319cce799792398964 Mon Sep 17 00:00:00 2001 From: davdhacs <105243888+davdhacs@users.noreply.github.com> Date: Mon, 9 Sep 2024 11:15:19 -0600 Subject: [PATCH] fix: allow unknown flavors in cost estimation (#1377) --- scripts/cost-estimation/render_costs.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/cost-estimation/render_costs.py b/scripts/cost-estimation/render_costs.py index a230dd490..b3c95f7ff 100644 --- a/scripts/cost-estimation/render_costs.py +++ b/scripts/cost-estimation/render_costs.py @@ -7,6 +7,7 @@ DAILY_COST_MAP = { "demo": 33, "gke-default": 10, + "ibmroks": 56, "openshift-4": 29, "openshift-4-demo": 53, "openshift-4-perf-scale": 70, @@ -14,10 +15,12 @@ "osd-on-gcp": 35, "qa-demo": 33, "osd-on-aws": 50, - "rosa": 97, + "rosa": 40, + "rosahcp": 23, "eks": 13, "aks": 17, "aro": 53, + "unknown": 25, } def read_usage_from_stdin(): @@ -39,7 +42,10 @@ def calculate_costs(usage): "total usage (days)": x["total_days_consumed"], } - current["cost (usd)"] = float(x["total_days_consumed"]) * DAILY_COST_MAP[x["flavor"]] + try: + current["cost (usd)"] = float(x["total_days_consumed"]) * DAILY_COST_MAP[x["flavor"]] + except KeyError: + current["cost (usd)"] = float(x["total_days_consumed"]) * DAILY_COST_MAP["unknown"] costs.append(current) return costs