Commit 8649c0c1 by Guba Sándor

Merge branch 'feature-md5sum' into 'master'

Feature md5sum

fixes #247

See merge request !246
parents 59814880 086490a4
...@@ -416,6 +416,7 @@ class Disk(TimeStampedModel): ...@@ -416,6 +416,7 @@ class Disk(TimeStampedModel):
"Operation aborted by user."), e) "Operation aborted by user."), e)
disk.size = result['size'] disk.size = result['size']
disk.type = result['type'] disk.type = result['type']
disk.checksum = result.get('checksum', None)
disk.is_ready = True disk.is_ready = True
disk.save() disk.save()
return disk return disk
......
...@@ -280,7 +280,6 @@ class DownloadDiskOperation(InstanceOperation): ...@@ -280,7 +280,6 @@ class DownloadDiskOperation(InstanceOperation):
async_queue = "localhost.man.slow" async_queue = "localhost.man.slow"
def _operation(self, user, url, task, activity, name=None): def _operation(self, user, url, task, activity, name=None):
activity.result = url
from storage.models import Disk from storage.models import Disk
disk = Disk.download(url=url, name=name, task=task) disk = Disk.download(url=url, name=name, task=task)
...@@ -294,6 +293,10 @@ class DownloadDiskOperation(InstanceOperation): ...@@ -294,6 +293,10 @@ class DownloadDiskOperation(InstanceOperation):
activity.readable_name = create_readable( activity.readable_name = create_readable(
ugettext_noop("download %(name)s"), name=disk.name) ugettext_noop("download %(name)s"), name=disk.name)
activity.result = create_readable(ugettext_noop(
"Downloading %(url)s is finished. The file md5sum "
"is: '%(checksum)s'."),
url=url, checksum=disk.checksum)
# TODO iso (cd) hot-plug is not supported by kvm/guests # TODO iso (cd) hot-plug is not supported by kvm/guests
if self.instance.is_running and disk.type not in ["iso"]: if self.instance.is_running and disk.type not in ["iso"]:
self.instance._attach_disk(parent_activity=activity, disk=disk) self.instance._attach_disk(parent_activity=activity, disk=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