WIP for change file backends

This commit is contained in:
2016-08-26 10:49:55 +02:00
committed by Sybren A. Stüvel
parent 163db3f2b8
commit 225f9ae054
2 changed files with 123 additions and 34 deletions

View File

@@ -389,3 +389,14 @@ def check_cdnsun():
print('Missing main: %i' % missing_main)
print('Missing vars: %i' % missing_variation)
@manager.command
def file_change_backend(file_id, dest_backend='gcs'):
"""Given a file document, move it to the specified backend (if not already
there) and update the document to reflect that.
Files on the original backend are not deleted automatically.
"""
from pillar.api.file_storage import change_file_storage_backend
change_file_storage_backend(file_id, dest_backend)