Skip to content

Commit

Permalink
BUG: fix issue with local-storage-type not taking effect
Browse files Browse the repository at this point in the history
  • Loading branch information
anish-mudaraddi committed Feb 7, 2024
1 parent 02d3222 commit ee1b4cc
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions MonitoringTools/usr/local/bin/slottifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def get_valid_flavors_for_aggregate(flavor_list: List, aggregate: Dict) -> List:
"""
valid_flavors = []
hypervisor_hosttype = aggregate["metadata"].get("hosttype", None)
hypervisor_storage_type = aggregate["metadata"].get("local-storage-type", None)

if not hypervisor_hosttype:
return valid_flavors
Expand All @@ -89,6 +90,15 @@ def get_valid_flavors_for_aggregate(flavor_list: List, aggregate: Dict) -> List:
!= hypervisor_hosttype
):
continue

has_local_storage = "aggregate_instance_extra_specs:local-storage-type" in flavor["extra_specs"].keys()

if (
has_local_storage and flavor["extra_specs"]["aggregate_instance_extra_specs:local-storage-type"]
!= hypervisor_storage_type
):
continue

valid_flavors.append(flavor)
return valid_flavors

Expand Down

0 comments on commit ee1b4cc

Please sign in to comment.