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

Added GCP re-init condition if GCP config is missing. #286

Merged
merged 2 commits into from
Apr 26, 2022
Merged
Changes from 1 commit
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
5 changes: 5 additions & 0 deletions skylark/cli/cli_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import boto3
import typer
from skylark import GB, MB
from skylark import gcp_config_path
from skylark.compute.aws.aws_auth import AWSAuthentication
from skylark.compute.azure.azure_auth import AzureAuthentication
from skylark.compute.gcp.gcp_auth import GCPAuthentication
Expand Down Expand Up @@ -397,6 +398,10 @@ def load_gcp_config(config: SkylarkConfig, force_init: bool = False) -> SkylarkC
typer.secho(" GCP credentials will be re-initialized", fg="red")
config.gcp_project_id = None

if not Path(gcp_config_path).is_file():
typer.secho(" GCP region config missing! GCP will be reconfigured.", fg="red")
config.gcp_project_id = None

if config.gcp_project_id is not None:
typer.secho(" GCP already configured! To reconfigure GCP, run `skylark init --reinit-gcp`.", fg="blue")
config.gcp_enabled = True
Expand Down