From 713dd5dae54d38d9de28fae323c870e7e679ae16 Mon Sep 17 00:00:00 2001 From: Thirumalesh Aaraveti Date: Mon, 18 Nov 2024 19:59:20 +0530 Subject: [PATCH] race-condition to check account_id --- .../common/clouds/ibm/account/ibm_authenticator.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cloud_governance/common/clouds/ibm/account/ibm_authenticator.py b/cloud_governance/common/clouds/ibm/account/ibm_authenticator.py index e933284b..8de0a534 100644 --- a/cloud_governance/common/clouds/ibm/account/ibm_authenticator.py +++ b/cloud_governance/common/clouds/ibm/account/ibm_authenticator.py @@ -14,7 +14,10 @@ class IBMAuthenticator: def __init__(self): logging.disable(logging.DEBUG) self.env_config = environment_variables - self.account_id = self.env_config.IBM_ACCOUNT_ID + if hasattr(self.env_config, 'IBM_ACCOUNT_ID'): + self.account_id = self.env_config.IBM_ACCOUNT_ID + else: + self.account_id = self.env_config.environment_variables_dict.get('ACCOUNT_ID') if hasattr(self.env_config, 'IBM_CLOUD_API_KEY'): self.__api_key = self.env_config.IBM_CLOUD_API_KEY else: