[lxc-devel] [lxd/master] Show underlying error when container delete fails

stgraber on Github lxc-bot at linuxcontainers.org
Wed Jul 12 02:52:43 UTC 2017


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/20170712/38085d31/attachment.bin>
-------------- next part --------------
From 40d984fa8c0008b70eac6339748225acbf92bda6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Tue, 11 Jul 2017 13:09:24 -0400
Subject: [PATCH] Show underlying error when container delete fails
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/container_lxc.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lxd/container_lxc.go b/lxd/container_lxc.go
index 2d97d8509..952c9b7b9 100644
--- a/lxd/container_lxc.go
+++ b/lxd/container_lxc.go
@@ -2770,7 +2770,7 @@ func (c *containerLXC) Delete() error {
 		// Delete the container from disk
 		if shared.PathExists(c.Path()) && c.storage != nil {
 			if err := c.storage.ContainerDelete(c); err != nil {
-				logger.Error("Failed deleting container storage", ctxMap)
+				logger.Error("Failed deleting container storage",log.Ctx{"name": c.Name(), "err": err})
 				return err
 			}
 		}
@@ -2778,7 +2778,7 @@ func (c *containerLXC) Delete() error {
 
 	// Remove the database record
 	if err := dbContainerRemove(c.daemon.db, c.Name()); err != nil {
-		logger.Error("Failed deleting container entry", ctxMap)
+		logger.Error("Failed deleting container entry",log.Ctx{"name": c.Name(), "err": err})
 		return err
 	}
 


More information about the lxc-devel mailing list