[lxc-devel] [lxd/master] lxc/image: always use long fingerprint in exported filenames

albertodonato on Github lxc-bot at linuxcontainers.org
Wed Jul 12 08:07:46 UTC 2017


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 408 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20170712/3bb1d731/attachment.bin>
-------------- next part --------------
From b2a8f95e94e40c82eeb89ac621016dae99459495 Mon Sep 17 00:00:00 2001
From: Alberto Donato <alberto.donato at canonical.com>
Date: Wed, 12 Jul 2017 10:06:24 +0200
Subject: [PATCH] lxc/image: always use long fingerprint in exported filenames.

Signed-off-by: Alberto Donato <alberto.donato at canonical.com>
---
 lxd/images.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lxd/images.go b/lxd/images.go
index 4afb59ea9..9b04cff4b 100644
--- a/lxd/images.go
+++ b/lxd/images.go
@@ -1533,7 +1533,7 @@ func imageExport(d *Daemon, r *http.Request) Response {
 	if err != nil {
 		ext = ""
 	}
-	filename := fmt.Sprintf("%s%s", fingerprint, ext)
+	filename := fmt.Sprintf("%s%s", imgInfo.Fingerprint, ext)
 
 	if shared.PathExists(rootfsPath) {
 		files := make([]fileResponseEntry, 2)
@@ -1548,7 +1548,7 @@ func imageExport(d *Daemon, r *http.Request) Response {
 		if err != nil {
 			ext = ""
 		}
-		filename = fmt.Sprintf("%s%s", fingerprint, ext)
+		filename = fmt.Sprintf("%s%s", imgInfo.Fingerprint, ext)
 
 		files[1].identifier = "rootfs"
 		files[1].path = rootfsPath


More information about the lxc-devel mailing list