Fix initialization value of stack_cost 17/63417/1
authorAndrew Grimberg <agrimberg@linuxfoundation.org>
Fri, 13 Mar 2020 20:51:42 +0000 (13:51 -0700)
committerAndrew Grimberg <agrimberg@linuxfoundation.org>
Fri, 13 Mar 2020 20:51:42 +0000 (13:51 -0700)
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 <agrimberg@linuxfoundation.org>
lftools/openstack/stack.py
releasenotes/notes/fix_stack_cost-4c8176a9d0a286a4.yaml [new file with mode: 0644]

index e45a376..9ab0261 100644 (file)
@@ -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 (file)
index 0000000..1d7c9ad
--- /dev/null
@@ -0,0 +1,4 @@
+---
+fixes:
+  - |
+    Fix stack_cost initialization value