From: Andrew Grimberg Date: Fri, 13 Mar 2020 20:51:42 +0000 (-0700) Subject: Fix initialization value of stack_cost X-Git-Tag: v0.31.2~1 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F17%2F63417%2F1;p=releng%2Flftools.git 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 --- 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