Просмотр исходного кода

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

baizhang 8 лет назад
Родитель
Сommit
9e2f187aac
1 измененных файлов с 1 добавлено и 1 удалено
  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.