[lxc-devel] [lxd/master] lxc: Changes lxc list and lxc info Type field to show instance type
tomponline on Github
lxc-bot at linuxcontainers.org
Mon Oct 7 10:50:59 UTC 2019
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 361 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20191007/c63d7175/attachment.bin>
-------------- next part --------------
From b078e07ecd6654f78753c640e58f5f04857bab18 Mon Sep 17 00:00:00 2001
From: Thomas Parrott <thomas.parrott at canonical.com>
Date: Thu, 19 Sep 2019 12:50:45 +0100
Subject: [PATCH] lxc: Changes lxc list and lxc info Type field to show
instance type
Signed-off-by: Thomas Parrott <thomas.parrott at canonical.com>
---
lxc/info.go | 7 ++-----
lxc/list.go | 6 +-----
2 files changed, 3 insertions(+), 10 deletions(-)
diff --git a/lxc/info.go b/lxc/info.go
index 6402ce53da..41b6702aa7 100644
--- a/lxc/info.go
+++ b/lxc/info.go
@@ -449,11 +449,8 @@ func (c *cmdInfo) containerInfo(d lxd.InstanceServer, remote config.Remote, name
}
fmt.Printf(i18n.G("Status: %s")+"\n", ct.Status)
- if ct.Ephemeral {
- fmt.Printf(i18n.G("Type: ephemeral") + "\n")
- } else {
- fmt.Printf(i18n.G("Type: persistent") + "\n")
- }
+ fmt.Printf(i18n.G("Type: %s")+"\n", ct.Type)
+
fmt.Printf(i18n.G("Profiles: %s")+"\n", strings.Join(ct.Profiles, ", "))
if cs.Pid != 0 {
fmt.Printf(i18n.G("Pid: %d")+"\n", cs.Pid)
diff --git a/lxc/list.go b/lxc/list.go
index 04234d6447..8bd3598f84 100644
--- a/lxc/list.go
+++ b/lxc/list.go
@@ -620,11 +620,7 @@ func (c *cmdList) IP6ColumnData(cInfo api.InstanceFull) string {
}
func (c *cmdList) typeColumnData(cInfo api.InstanceFull) string {
- if cInfo.Ephemeral {
- return i18n.G("EPHEMERAL")
- }
-
- return i18n.G("PERSISTENT")
+ return i18n.G(strings.ToUpper(cInfo.Type))
}
func (c *cmdList) numberSnapshotsColumnData(cInfo api.InstanceFull) string {
More information about the lxc-devel
mailing list