Commit 7a8c2ac5 by Bálint Máhonfai

Use the store to upload exported disk

parent 31c9b14a
Pipeline #948 passed with stage
in 0 seconds
......@@ -360,8 +360,18 @@ class ExportDiskOperation(InstanceOperation):
accept_states = ('STOPPED',)
async_queue = 'localhost.man.slow'
def _operation(self, disk, format):
disk.export(format)
def check_auth(self, user):
super(ExportDiskOperation, self).check_auth(user)
try:
Store(user)
except NoStoreException:
raise PermissionDenied
def _operation(self, user, disk, format):
store = Store(user)
store.new_folder('/export')
upload_link = store.request_upload('/export')
disk.export(format, upload_link)
@register_operation
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment