From 4e0d582cd06d3ad3f153883bf84b976e07c5f4ba Mon Sep 17 00:00:00 2001 From: Simone Orsi Date: Tue, 4 Feb 2020 11:42:35 +0100 Subject: [PATCH] cloud_platform: fix default config `_config_by_server_env` should always retutn a `PlatformConfig` instance --- cloud_platform/models/cloud_platform.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cloud_platform/models/cloud_platform.py b/cloud_platform/models/cloud_platform.py index 56c2648..225247d 100644 --- a/cloud_platform/models/cloud_platform.py +++ b/cloud_platform/models/cloud_platform.py @@ -34,6 +34,9 @@ class FilestoreKind(object): file = 'file' +DefaultConfig = PlatformConfig(filestore=FilestoreKind.db) + + class CloudPlatform(models.AbstractModel): _name = 'cloud.platform' @@ -63,7 +66,7 @@ class CloudPlatform(models.AbstractModel): None ) configs = configs_getter() if configs_getter else {} - return configs.get(environment) or FilestoreKind.db + return configs.get(environment) or DefaultConfig # Due to the addition of the ovh cloud platform # This will be moved to cloud_platform_exoscale on v11