The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/2331

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===

From 6d84f345d677cac326cbaa3aa3e2fa65c69b0950 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgra...@ubuntu.com>
Date: Wed, 31 Aug 2016 21:35:01 -0400
Subject: [PATCH] Allow unsetting any config key
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Prevents a DB failure when trying to unset one of the volatile network
keys (name or hwaddr).

Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
---
 lxd/container_lxc.go | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/lxd/container_lxc.go b/lxd/container_lxc.go
index 50a1ec9..ed9ef60 100644
--- a/lxd/container_lxc.go
+++ b/lxd/container_lxc.go
@@ -2192,11 +2192,6 @@ func (c *containerLXC) Update(args containerArgs, 
userRequested bool) error {
                return err
        }
 
-       err = c.initLXC()
-       if err != nil {
-               return err
-       }
-
        // Diff the configurations
        changedConfig := []string{}
        for key, _ := range oldExpandedConfig {
@@ -2649,6 +2644,14 @@ func (c *containerLXC) Update(args containerArgs, 
userRequested bool) error {
                return err
        }
 
+       // Invalidate the go-lxc cache
+       c.c = nil
+
+       err = c.initLXC()
+       if err != nil {
+               return err
+       }
+
        // Success, update the closure to mark that the changes should be kept.
        undoChanges = false
 
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to