From 974ac6867c9e5a5f67619431af21deb05d872c6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 8 Jan 2019 14:45:46 +0100 Subject: [PATCH] Moved storage backend names to a module-global constant This allows others to import the constant and have proper 'allowed' values for backends. This will be used by Flamenco for storing task logs. --- pillar/api/eve_settings.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pillar/api/eve_settings.py b/pillar/api/eve_settings.py index b12d3b8e..c980066d 100644 --- a/pillar/api/eve_settings.py +++ b/pillar/api/eve_settings.py @@ -1,5 +1,6 @@ import os +STORAGE_BACKENDS = ["local", "pillar", "cdnsun", "gcs", "unittest"] URL_PREFIX = 'api' # Enable reads (GET), inserts (POST) and DELETE for resources/collections @@ -463,7 +464,7 @@ files_schema = { 'backend': { 'type': 'string', 'required': True, - 'allowed': ["local", "pillar", "cdnsun", "gcs", "unittest"] + 'allowed': STORAGE_BACKENDS, }, # Where the file is in the backend storage itself. In the case of GCS,