From 7bcc2d09bf6a5dd910b4d676a993a97361192447 Mon Sep 17 00:00:00 2001 From: John Garbutt Date: Tue, 5 Nov 2024 14:56:39 +0000 Subject: [PATCH] Fix error "flavor_names" is not defined (#21) A previous commit stopped the collector working: 004077b5d071fb39fedefffee09d2d8d31cd3f23 --- os_capacity/prometheus.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/os_capacity/prometheus.py b/os_capacity/prometheus.py index 8db0b18..58253e9 100755 --- a/os_capacity/prometheus.py +++ b/os_capacity/prometheus.py @@ -190,7 +190,8 @@ def get_host_details(compute_client, placement_client): rp = resource_providers[hostname] rp_id = rp["uuid"] free_space_found = False - for flavor_name in flavor_names: + for flavor in flavors: + flavor_name = flavor.name all_counts = capacity_per_flavor.get(flavor_name, {}) our_count = all_counts.get(rp_id, 0) if our_count == 0: