diff --git a/nebari/cli/init.py b/nebari/cli/init.py index 06bb29d5a..7ff974d6a 100644 --- a/nebari/cli/init.py +++ b/nebari/cli/init.py @@ -42,8 +42,10 @@ CHOOSE_CLOUD_PROVIDER = "https://nebari.dev/docs/get-started/deploy" -def enum_to_list(enum_cls): - return [e.value.lower() for e in enum_cls] +def enum_to_list(enum_cls, lower=True): + if lower: + return [e.value.lower() for e in enum_cls] + return [e.value for e in enum_cls] def handle_init(inputs: InitInputs): @@ -290,7 +292,6 @@ def guided_init_wizard(ctx: typer.Context, guided_init: str): """ qmark = " " disable_checks = os.environ.get("NEBARI_DISABLE_INIT_CHECKS", False) - if Path("nebari-config.yaml").exists(): raise ValueError( "A nebari-config.yaml file already exists. Please move or delete it and try again." @@ -330,24 +331,25 @@ def guided_init_wizard(ctx: typer.Context, guided_init: str): # try: inputs.cloud_provider = questionary.select( "Where would you like to deploy your Nebari cluster?", - choices=enum_to_list(ProviderEnum), + choices=enum_to_list(ProviderEnum, lower=False), qmark=qmark, ).unsafe_ask() + inputs.cloud_provider = ProviderEnum(inputs.cloud_provider).name + if not disable_checks: check_cloud_provider_creds(ctx, cloud_provider=inputs.cloud_provider) # specific context needed when `check_project_name` is called ctx.params["cloud_provider"] = inputs.cloud_provider - name_guidelines = """ The project name must adhere to the following requirements: - Letters from A to Z (upper and lower case) and numbers - Maximum accepted length of the name string is 16 characters """ - if inputs.cloud_provider == ProviderEnum.aws.value.lower(): + if inputs.cloud_provider == ProviderEnum.aws.name: name_guidelines += "- Should NOT start with the string `aws`\n" - elif inputs.cloud_provider == ProviderEnum.azure.value.lower(): + elif inputs.cloud_provider == ProviderEnum.azure.name: name_guidelines += "- Should NOT contain `-`\n" # PROJECT NAME diff --git a/nebari/schema.py b/nebari/schema.py index a8cef633b..4f2e40f17 100644 --- a/nebari/schema.py +++ b/nebari/schema.py @@ -24,12 +24,12 @@ class TerraformStateEnum(str, enum.Enum): class ProviderEnum(str, enum.Enum): - local = "local" - existing = "existing" - do = "do" - aws = "aws" - gcp = "gcp" - azure = "azure" + local = "Local test k8s cluster (using 'kind')" + existing = "Existing k8s cluster" + do = "DigitalOcean (DO)" + aws = "Amazon Web Services (AWS)" + gcp = "Google Cloud Platform (GCP)" + azure = "Microsoft Azure (Azure)" class GitRepoEnum(str, enum.Enum):