Explorar o código

Address review comment to use os.getenv() with default value.

baizhang %!s(int64=8) %!d(string=hai) anos
pai
achega
9e2f187aac
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      cloudbridge/cloud/providers/gce/provider.py

+ 1 - 1
cloudbridge/cloud/providers/gce/provider.py

@@ -142,7 +142,7 @@ class GCECloudProvider(BaseCloudProvider):
             'gce_service_creds_file', os.environ.get('GCE_SERVICE_CREDS_FILE'))
         self.credentials_dict = self._get_config_value(
             'gce_service_creds_dict',
-            json.loads(os.environ.get('GCE_SERVICE_CREDS_DICT') or '{}'))
+            json.loads(os.getenv('GCE_SERVICE_CREDS_DICT', '{}')))
         # If 'gce_service_creds_dict' is not passed in from config and
         # self.credentials_file is available, read and parse the json file to
         # self.credentials_dict.