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

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) ===
Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
From b6f1c56bc7b5c9622438a7ef38ae29aea98d934f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgra...@ubuntu.com>
Date: Fri, 20 Jul 2018 10:54:41 -0400
Subject: [PATCH] lxd/networks: Fix revert on update failure
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

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

diff --git a/lxd/networks.go b/lxd/networks.go
index 7b863f0dd..b81963be4 100644
--- a/lxd/networks.go
+++ b/lxd/networks.go
@@ -1751,8 +1751,15 @@ func (n *network) Update(newNetwork api.NetworkPut) 
error {
        undoChanges := true
        defer func() {
                if undoChanges {
+                       // Revert changes to the struct
                        n.config = oldConfig
                        n.description = oldDescription
+
+                       // Update the database
+                       n.state.Cluster.NetworkUpdate(n.name, n.description, 
n.config)
+
+                       // Reset any change that was made to the bridge
+                       n.Start()
                }
        }()
 
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to