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

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 3250632d02ffcc7761a5310e9295f9a6e9b7bb86 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgra...@ubuntu.com>
Date: Mon, 7 Oct 2019 14:47:25 -0400
Subject: [PATCH] lxc/{list,info}: Fix type on older LXD
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
---
 lxc/info.go | 4 ++++
 lxc/list.go | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/lxc/info.go b/lxc/info.go
index 95a119563d..d1bf736363 100644
--- a/lxc/info.go
+++ b/lxc/info.go
@@ -450,6 +450,10 @@ func (c *cmdInfo) containerInfo(d lxd.InstanceServer, 
remote config.Remote, name
 
        fmt.Printf(i18n.G("Status: %s")+"\n", ct.Status)
 
+       if ct.Type == "" {
+               ct.Type = "container"
+       }
+
        if ct.Ephemeral {
                fmt.Printf(i18n.G("Type: %s (ephemeral)")+"\n", ct.Type)
        } else {
diff --git a/lxc/list.go b/lxc/list.go
index 796251404f..1253b532ab 100644
--- a/lxc/list.go
+++ b/lxc/list.go
@@ -620,6 +620,10 @@ func (c *cmdList) IP6ColumnData(cInfo api.InstanceFull) 
string {
 }
 
 func (c *cmdList) typeColumnData(cInfo api.InstanceFull) string {
+       if cInfo.Type == "" {
+               cInfo.Type = "container"
+       }
+
        if cInfo.Ephemeral {
                return fmt.Sprintf("%s (%s)", strings.ToUpper(cInfo.Type), 
i18n.G("EPHEMERAL"))
        }
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to