[lxc-devel] [distrobuilder/master] sources: Fix openSUSE image verification

monstermunchkin on Github lxc-bot at linuxcontainers.org
Thu Mar 28 14:54:54 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 364 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190328/f6ead670/attachment.bin>
-------------- next part --------------
From d1a297d0543e6b18351e902c3f1d25a41fa54a72 Mon Sep 17 00:00:00 2001
From: Thomas Hipp <thomas.hipp at canonical.com>
Date: Thu, 28 Mar 2019 15:54:06 +0100
Subject: [PATCH] sources: Fix openSUSE image verification

Signed-off-by: Thomas Hipp <thomas.hipp at canonical.com>
---
 sources/opensuse-http.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sources/opensuse-http.go b/sources/opensuse-http.go
index ddcc80b..cc5ddf9 100644
--- a/sources/opensuse-http.go
+++ b/sources/opensuse-http.go
@@ -92,7 +92,7 @@ func (s *OpenSUSEHTTP) Run(definition shared.Definition, rootfsDir string) error
 	image.Close()
 
 	result := fmt.Sprintf("%x", hash.Sum(nil))
-	checksumStr := strings.TrimSpace(string(checksum))
+	checksumStr := strings.Split(string(checksum), " ")[0]
 
 	if result != checksumStr {
 		return fmt.Errorf("Hash mismatch for %s: %s != %s", imagePath, result, checksumStr)


More information about the lxc-devel mailing list