Commit 746b4b08 by Máhonfai Bálint

Switch disk import to SSH

parent 239f9e7b
......@@ -477,7 +477,7 @@ class Disk(TimeStampedModel):
return disk
@classmethod
def import_disk(cls, user, name, download_link, task):
def import_disk(cls, user, name, download_link, port, task):
params = {'name': name,
'type': 'qcow2-norm'}
disk = cls.__create(user=user, params=params)
......@@ -486,7 +486,7 @@ class Disk(TimeStampedModel):
kwargs={
"disk_desc": disk.get_disk_desc(),
"url": download_link,
"task": task.request.id
"port": port
},
queue=queue_name
)
......
......@@ -352,7 +352,6 @@ class ImportDiskOperation(InstanceOperation):
'from the user store. The disk image has to be in the '
'root directory of the store.')
abortable = True
has_percentage = True
required_perms = ('storage.import_disk',)
accept_states = ('STOPPED', 'PENDING', 'RUNNING')
async_queue = 'localhost.man.slow'
......@@ -366,8 +365,8 @@ class ImportDiskOperation(InstanceOperation):
def _operation(self, user, name, disk_path, task):
store = Store(user)
download_link = store.request_download(disk_path)
disk = Disk.import_disk(user, name, download_link, task)
download_link, port = store.request_ssh_download(disk_path)
disk = Disk.import_disk(user, name, download_link, port, task)
self.instance.disks.add(disk)
......
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