[lxc-devel] [lxd/master] lxc: Populate cmdConsole.flagType also when ran manually

freeekanayaka on Github lxc-bot at linuxcontainers.org
Mon Jul 13 08:52:27 UTC 2020


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/20200713/2cc8faef/attachment.bin>
-------------- next part --------------
From 75561180f171b1980cc929cea60b9c58c61ccb56 Mon Sep 17 00:00:00 2001
From: Free Ekanayaka <free.ekanayaka at canonical.com>
Date: Mon, 13 Jul 2020 10:50:50 +0200
Subject: [PATCH] lxc: Populate cmdConsole.flagType also when ran manually

Signed-off-by: Free Ekanayaka <free.ekanayaka at canonical.com>
---
 lxc/console.go | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lxc/console.go b/lxc/console.go
index 1646c5a3db..4afe936231 100644
--- a/lxc/console.go
+++ b/lxc/console.go
@@ -147,6 +147,9 @@ func (c *cmdConsole) Run(cmd *cobra.Command, args []string) error {
 }
 
 func (c *cmdConsole) Console(d lxd.InstanceServer, name string) error {
+	if c.flagType == "" {
+		c.flagType = "console"
+	}
 	switch c.flagType {
 	case "console":
 		return c.console(d, name)


More information about the lxc-devel mailing list