Replace storage backend 'pillar' with 'local'

The backend 'pillar' is obsolete; 'local' is the modernity and uses our
nice storage API.
This commit is contained in:
Sybren A. Stüvel 2018-01-26 14:13:03 +01:00
parent 75e2402420
commit 2e2314c16b
4 changed files with 5 additions and 5 deletions

View File

@ -363,7 +363,7 @@ def generate_link(backend, file_path: str, project_id: str=None, is_public=False
return blob.get_url(is_public=is_public) return blob.get_url(is_public=is_public)
if backend == 'pillar': if backend == 'pillar': # obsolete, replace with local.
return url_for('file_storage.index', file_name=file_path, return url_for('file_storage.index', file_name=file_path,
_external=True, _scheme=current_app.config['SCHEME']) _external=True, _scheme=current_app.config['SCHEME'])
if backend == 'cdnsun': if backend == 'cdnsun':

View File

@ -16,7 +16,7 @@ node_type_storage = {
'subdir': { 'subdir': {
'type': 'string', 'type': 'string',
}, },
# Which backend is used to store the files (gcs, pillar, bam, cdnsun) # Which backend is used to store the files (gcs, local)
'backend': { 'backend': {
'type': 'string', 'type': 'string',
}, },

View File

@ -38,7 +38,7 @@ EXAMPLE_FILE = {'_id': ObjectId('5672e2c1c379cf0007b31995'),
'_created': datetime.datetime(2015, 12, 17, 16, 28, 49, tzinfo=tz_util.utc), '_created': datetime.datetime(2015, 12, 17, 16, 28, 49, tzinfo=tz_util.utc),
'md5': '', 'md5': '',
'file_path': 'c2a5c897769ce1ef0eb10f8fa1c472bcb8e2d5a4.png', 'file_path': 'c2a5c897769ce1ef0eb10f8fa1c472bcb8e2d5a4.png',
'backend': 'pillar', 'backend': 'local',
'link': 'http://localhost:8002/file', 'link': 'http://localhost:8002/file',
'link_expires': datetime.datetime(2016, 3, 22, 9, 28, 22, tzinfo=tz_util.utc)} 'link_expires': datetime.datetime(2016, 3, 22, 9, 28, 22, tzinfo=tz_util.utc)}

View File

@ -33,7 +33,7 @@ EXAMPLE_FILE = {
'user': ObjectId('56264fc4fa3a250344bd10c5'), 'user': ObjectId('56264fc4fa3a250344bd10c5'),
'content_type': 'image/png', 'content_type': 'image/png',
'file_path': 'c2a5c897769ce1ef0eb10f8fa1c472bcb8e2d5a4.png', 'file_path': 'c2a5c897769ce1ef0eb10f8fa1c472bcb8e2d5a4.png',
'backend': 'pillar', 'backend': 'local',
'link': 'http://localhost:8002/file', 'link': 'http://localhost:8002/file',
} }
@ -58,7 +58,7 @@ class FileLinkCeleryTasksTest(AbstractPillarTest):
'link_expires': now + datetime.timedelta(hours=1, minutes=57)}) 'link_expires': now + datetime.timedelta(hours=1, minutes=57)})
# Not same backend → ignore # Not same backend → ignore
fid4, file_4 = self.ensure_file_exists({ fid4, file_4 = self.ensure_file_exists({
'backend': 'pillar', 'backend': 'local',
'link_expires': now + datetime.timedelta(hours=1, minutes=58)}) 'link_expires': now + datetime.timedelta(hours=1, minutes=58)})
# Same as fid3 → refresh # Same as fid3 → refresh
fid5, _ = self.ensure_file_exists({ fid5, _ = self.ensure_file_exists({