The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/4297

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
From 1f8cc377399a3af2a95c7402dc9c5db0f5a78f91 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgra...@ubuntu.com>
Date: Fri, 2 Mar 2018 09:36:19 -0500
Subject: [PATCH] Fix version parsing of LXC betas
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
---
 lxd/util/sys.go | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lxd/util/sys.go b/lxd/util/sys.go
index cb64982236..054dabb94e 100644
--- a/lxd/util/sys.go
+++ b/lxd/util/sys.go
@@ -91,6 +91,7 @@ func RuntimeLiblxcVersionAtLeast(major int, minor int, micro 
int) bool {
        parts := strings.Split(version, ".")
        partsLen := len(parts)
        if partsLen == 0 {
+               logger.Errorf("partsLen")
                return false
        }
 
@@ -104,12 +105,12 @@ func RuntimeLiblxcVersionAtLeast(major int, minor int, 
micro int) bool {
        mic := -1
 
        for i, v := range parts {
-               num, err := strconv.Atoi(v)
-               if err != nil {
-                       return false
+               if i > 2 {
+                       break
                }
 
-               if i > 2 {
+               num, err := strconv.Atoi(v)
+               if err != nil {
                        return false
                }
 
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to