[lxc-devel] [lxd/master] lxd/shutdown: Fix typo in error handling

stgraber on Github lxc-bot at linuxcontainers.org
Wed Mar 7 07:51:15 UTC 2018


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 354 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20180307/458f554d/attachment.bin>
-------------- next part --------------
From 0f5237af19a4e27adc2f0c84d236db45ba5e2446 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Wed, 7 Mar 2018 08:50:45 +0100
Subject: [PATCH] lxd/shutdown: Fix typo in error handling
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

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

diff --git a/lxd/main_shutdown.go b/lxd/main_shutdown.go
index 53f80366b2..8e6d642be1 100644
--- a/lxd/main_shutdown.go
+++ b/lxd/main_shutdown.go
@@ -18,7 +18,7 @@ func cmdShutdown(args *Args) error {
 	}
 
 	_, _, err = c.RawQuery("PUT", "/internal/shutdown", nil, "")
-	if err != nil && strings.HasSuffix(err.Error(), ": EOF") {
+	if err != nil && !strings.HasSuffix(err.Error(), ": EOF") {
 		// NOTE: if we got an EOF error here it means that the daemon
 		// has shutdown so quickly that it already closed the unix
 		// socket. We consider the daemon dead in this case.


More information about the lxc-devel mailing list