mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-10 14:55:00 +00:00
fix(gcp): handle error when Project ID is None (#2130)
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user