[lxc-devel] [lxd/master] actually handle containers list error

tych0 on Github lxc-bot at linuxcontainers.org
Tue Aug 2 23:33:33 UTC 2016


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/20160802/44a762c6/attachment.bin>
-------------- next part --------------
From bfeaf76a039ff273bb3660ad321b6babf1da7c77 Mon Sep 17 00:00:00 2001
From: Tycho Andersen <tycho.andersen at canonical.com>
Date: Tue, 2 Aug 2016 17:30:28 -0600
Subject: [PATCH] actually handle containers list error

Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
---
 lxd/devices.go | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lxd/devices.go b/lxd/devices.go
index 529450d..ddbcc63 100644
--- a/lxd/devices.go
+++ b/lxd/devices.go
@@ -203,6 +203,10 @@ func deviceTaskBalance(d *Daemon) {
 
 	// Iterate through the containers
 	containers, err := dbContainersList(d.db, cTypeRegular)
+	if err != nil {
+		shared.Log.Error("problem loading containers list", log.Ctx{"err": err})
+		return
+	}
 	fixedContainers := map[int][]container{}
 	balancedContainers := map[container]int{}
 	for _, name := range containers {


More information about the lxc-devel mailing list