[lxc-devel] [lxd/master] Fix parsing image names containing dots

stgraber on Github lxc-bot at linuxcontainers.org
Thu Mar 10 20:21:28 UTC 2016


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 354 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20160310/92e6d7c7/attachment.bin>
-------------- next part --------------
From 8f77f240177162c598e3c40cb908de0e0b0df098 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Thu, 10 Mar 2016 15:20:48 -0500
Subject: [PATCH] Fix parsing image names containing dots
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 shared/simplestreams.go | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/shared/simplestreams.go b/shared/simplestreams.go
index e17b496..e74c50b 100644
--- a/shared/simplestreams.go
+++ b/shared/simplestreams.go
@@ -94,7 +94,8 @@ func (s *SimpleStreamsManifest) ToLXD() ([]ImageInfo, map[string][][]string) {
 
 		for name, version := range product.Versions {
 			// Short of anything better, use the name as date
-			creationDate, err := time.Parse(nameLayout, name)
+			fields := strings.Split(name, ".")
+			creationDate, err := time.Parse(nameLayout, fields[0])
 			if err != nil {
 				continue
 			}


More information about the lxc-devel mailing list