Skip to content

Commit

Permalink
Handle empty nodepool config
Browse files Browse the repository at this point in the history
  • Loading branch information
TristanCacqueray committed Nov 15, 2024
1 parent 9181981 commit d515061
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions zuul-capacity.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ def get_providers(nodepool_yaml):
"Get the cloud provider from the nodepool config."
providers = dict()
nodepool = yaml.safe_load(open(nodepool_yaml))
for provider in nodepool["providers"]:
if provider["driver"] == "openstack":
providers[provider["name"]] = Provider.from_nodepool(provider)
for provider in nodepool.get("providers", []):
if provider.get("driver") == "openstack" and provider.get("cloud"):
providers[provider.get("name", "unknown")] = Provider.from_nodepool(provider)
return providers

def update_provider_metric(metrics, name, provider):
Expand Down

0 comments on commit d515061

Please sign in to comment.