Skip to content

Commit

Permalink
Merge branch 'develop' into add-uptime-monitoring
Browse files Browse the repository at this point in the history
  • Loading branch information
dcmcand authored Aug 30, 2024
2 parents bfdcd21 + 400f0d0 commit 5aea0c5
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/_nebari/subcommands/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -934,16 +934,19 @@ def guided_init_wizard(ctx: typer.Context, guided_init: str):
)
)

base_cmd = f"nebari init {inputs.cloud_provider}"
base_cmd = f"nebari init {inputs.cloud_provider.value}"

def if_used(key, model=inputs, ignore_list=["cloud_provider"]):
if key not in ignore_list:
b = "--{key} {value}"
value = getattr(model, key)
if isinstance(value, str) and (value != "" or value is not None):
return b.format(key=key, value=value).replace("_", "-")
if isinstance(value, bool) and value:
return b.format(key=key, value=value).replace("_", "-")
if isinstance(value, enum.Enum):
return f"--{key} {value.value}".replace("_", "-")
elif isinstance(value, bool):
if value:
return f"--{key}".replace("_", "-")
elif isinstance(value, (int, str)):
if value:
return f"--{key} {value}".replace("_", "-")

cmds = " ".join(
[
Expand Down

0 comments on commit 5aea0c5

Please sign in to comment.