File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -409,8 +409,6 @@ def spawn(
409409 creds_data = None
410410 if os .path .exists (CLOUD_CONFIG_FPATH ):
411411 creds_data = read_json (CLOUD_CONFIG_FPATH )
412- if not creds_data :
413- raise CFRUserError ("Cloud configuration not found at %s" % CLOUD_CONFIG_FPATH )
414412
415413 vms_info = None
416414 if os .path .exists (CLOUD_STATE_FPATH ):
@@ -428,6 +426,10 @@ def spawn(
428426 sec_groups = None
429427 key_pair = None
430428 if provider == Providers .AWS :
429+ if not creds_data :
430+ raise CFRUserError (
431+ "Cloud configuration not found at %s" % CLOUD_CONFIG_FPATH
432+ )
431433 try :
432434 creds = _get_aws_creds_from_env () or AWSCredentials (
433435 creds_data ["aws" ]["key" ],
@@ -442,6 +444,10 @@ def spawn(
442444
443445 region = region or creds_data ["aws" ].get ("region" , "eu-west-1" )
444446 elif provider == Providers .GCP :
447+ if not creds_data :
448+ raise CFRUserError (
449+ "Cloud configuration not found at %s" % CLOUD_CONFIG_FPATH
450+ )
445451 try :
446452 creds = GCPCredentials (
447453 creds_data ["gcp" ]["project_id" ],
You can’t perform that action at this time.
0 commit comments