From 3b17357e57e063b40cf925734ec661ff36b65514 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 e302c0a..55b52b2 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' _description = 'cloud.platform' @@ -64,7 +67,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