Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] Adjusting reinit #753

Merged
merged 1 commit into from
Feb 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 18 additions & 9 deletions skyplane/cli/cli_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,19 +387,28 @@ def init(
cloud_config = SkyplaneConfig.default_config()

# load AWS config
typer.secho("\n(1) Configuring AWS:", fg="yellow", bold=True)
if not disable_config_aws:
cloud_config = load_aws_config(cloud_config, non_interactive=non_interactive)
if not (reinit_azure or reinit_gcp):
typer.secho("\n(1) Configuring AWS:", fg="yellow", bold=True)
if not disable_config_aws:
cloud_config = load_aws_config(cloud_config, non_interactive=non_interactive)

# load Azure config
typer.secho("\n(2) Configuring Azure:", fg="yellow", bold=True)
if not disable_config_azure:
cloud_config = load_azure_config(cloud_config, force_init=reinit_azure, non_interactive=non_interactive)
if not reinit_gcp:
if reinit_azure:
typer.secho("\nConfiguring Azure:", fg="yellow", bold=True)
else:
typer.secho("\n(2) Configuring Azure:", fg="yellow", bold=True)
if not disable_config_azure:
cloud_config = load_azure_config(cloud_config, force_init=reinit_azure, non_interactive=non_interactive)

# load GCP config
typer.secho("\n(3) Configuring GCP:", fg="yellow", bold=True)
if not disable_config_gcp:
cloud_config = load_gcp_config(cloud_config, force_init=reinit_gcp, non_interactive=non_interactive)
if not reinit_azure:
if reinit_gcp:
typer.secho("\nConfiguring GCP:", fg="yellow", bold=True)
else:
typer.secho("\n(3) Configuring GCP:", fg="yellow", bold=True)
if not disable_config_gcp:
cloud_config = load_gcp_config(cloud_config, force_init=reinit_gcp, non_interactive=non_interactive)

cloud_config.to_config_file(config_path)
typer.secho(f"\nConfig file saved to {config_path}", fg="green")
Expand Down