From dc91a739abcb1601fa7c18c33f71ea6be76517f2 Mon Sep 17 00:00:00 2001 From: Asim Biswal Date: Mon, 13 Feb 2023 22:32:07 +0000 Subject: [PATCH] adjusting reinit --- skyplane/cli/cli_init.py | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/skyplane/cli/cli_init.py b/skyplane/cli/cli_init.py index 22c9d3b7f..ccca4b783 100644 --- a/skyplane/cli/cli_init.py +++ b/skyplane/cli/cli_init.py @@ -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")