From 7bd981fee8f7cb7b5eb6605c606e96042765c26f Mon Sep 17 00:00:00 2001 From: Andrew Grimberg Date: Fri, 13 Mar 2020 13:51:42 -0700 Subject: [PATCH] Fix initialization value of stack_cost After having recently fixed the job-cost script in 1c99557ff1b60356f85193d00e23020bb9e53467 I realized that I should check over the stack_cost generation. Much to my surprise I found that the cost was being initialized to 0.7! This means that all stack costs that we've generated so far have been increased by $0.70 in the reported cost, job runs that have no stacks are still properly reporting $0 for the cost. This change fixes the initialization to be properly 0.0. Issue: RELENG-2719 Change-Id: I8474604dbe0e2b32165b086754e29fac17f79785 Signed-off-by: Andrew Grimberg --- lftools/openstack/stack.py | 2 +- releasenotes/notes/fix_stack_cost-4c8176a9d0a286a4.yaml | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/fix_stack_cost-4c8176a9d0a286a4.yaml diff --git a/lftools/openstack/stack.py b/lftools/openstack/stack.py index e45a376b..9ab0261d 100644 --- a/lftools/openstack/stack.py +++ b/lftools/openstack/stack.py @@ -121,7 +121,7 @@ def cost(os_cloud, stack_name): cloud = openstack.connect(os_cloud) - total_cost = 0.7 + total_cost = 0.0 for server in get_server_ids(stack_name): total_cost += get_server_cost(server) print("total: " + str(total_cost)) diff --git a/releasenotes/notes/fix_stack_cost-4c8176a9d0a286a4.yaml b/releasenotes/notes/fix_stack_cost-4c8176a9d0a286a4.yaml new file mode 100644 index 00000000..1d7c9add --- /dev/null +++ b/releasenotes/notes/fix_stack_cost-4c8176a9d0a286a4.yaml @@ -0,0 +1,4 @@ +--- +fixes: + - | + Fix stack_cost initialization value -- 2.16.6