fix(gcp): handle error when Project ID is None (#2130)

This commit is contained in:
Sergio Garcia
2023-03-24 18:30:33 +01:00
committed by GitHub
parent c14e7fb17a
commit 7c4d6eb02d
2 changed files with 4 additions and 1 deletions

View File

@@ -16,6 +16,9 @@ class GCP_Provider:
):
logger.info("Instantiating GCP Provider ...")
self.credentials, self.project_id = self.__set_credentials__(credentials_file)
if not self.project_id:
logger.critical("No Project ID associated to Google Credentials.")
sys.exit(1)
def __set_credentials__(self, credentials_file):
try:

View File

@@ -77,7 +77,7 @@ def mock_set_azure_credentials(*_):
def mock_set_gcp_credentials(*_):
return (None, None)
return (None, "project")
class Test_Set_Audit_Info: