[lxc-devel] [lxd/master] lxc/remote: Fix crash on bad remote name

stgraber on Github lxc-bot at linuxcontainers.org
Thu Aug 9 15:22:39 UTC 2018


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 370 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20180809/9c126967/attachment.bin>
-------------- next part --------------
From f0ec48c0786613a3c3f51e5bdc0655553bb9955d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Thu, 9 Aug 2018 11:21:44 -0400
Subject: [PATCH] lxc/remote: Fix crash on bad remote name
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Closes #4894

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

diff --git a/lxc/remote.go b/lxc/remote.go
index 9f3748771f..c931bddb25 100644
--- a/lxc/remote.go
+++ b/lxc/remote.go
@@ -653,7 +653,7 @@ func (c *cmdRemoteSwitch) Run(cmd *cobra.Command, args []string) error {
 	// Set the default remote
 	_, ok := conf.Remotes[args[0]]
 	if !ok {
-		return fmt.Errorf(i18n.G("Remote %s doesn't exist"), args[1])
+		return fmt.Errorf(i18n.G("Remote %s doesn't exist"), args[0])
 	}
 
 	conf.DefaultRemote = args[0]


More information about the lxc-devel mailing list