Skip to content

Commit

Permalink
revert some behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam-D-Lewis committed Dec 12, 2024
1 parent 237f73b commit 40d71d6
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions src/_nebari/stages/infrastructure/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,21 +618,19 @@ def check_provider(cls, data: Any) -> Any:
raise ValueError(
f"'{provider}' is not a valid enumeration member; permitted: local, existing, aws, gcp, azure"
)

set_providers = [
provider
for provider in provider_name_abbreviation_map.keys()
if provider in data and data[provider]
]
num_providers = len(set_providers)
if num_providers > 1:
raise ValueError(
f"Only a single provider may be set. Multiple providers are set: {set_providers}"
)
elif num_providers == 1:
data["provider"] = provider_name_abbreviation_map[set_providers[0]]
elif num_providers == 0:
data["provider"] = schema.ProviderEnum.local.value
else:
set_providers = [
provider
for provider in provider_name_abbreviation_map.keys()
if provider in data
]
num_providers = len(set_providers)
if num_providers > 1:
raise ValueError(f"Multiple providers set: {set_providers}")
elif num_providers == 1:
data["provider"] = provider_name_abbreviation_map[set_providers[0]]
elif num_providers == 0:
data["provider"] = schema.ProviderEnum.local.value

return data

Expand Down

0 comments on commit 40d71d6

Please sign in to comment.