[lxc-devel] [lxd/master] lxd/profiles: Fix project update when clustered

stgraber on Github lxc-bot at linuxcontainers.org
Thu Feb 28 11:03:23 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 370 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190228/bba9298c/attachment.bin>
-------------- next part --------------
From 50d0dff2131b921854884fa03f451b027d69e4fd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Thu, 28 Feb 2019 11:35:58 +0100
Subject: [PATCH] lxd/profiles: Fix project update when clustered
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Closes #5493

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 lxd/profiles.go | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lxd/profiles.go b/lxd/profiles.go
index 126d19be37..3be0be4229 100644
--- a/lxd/profiles.go
+++ b/lxd/profiles.go
@@ -200,9 +200,9 @@ func profilePut(d *Daemon, r *http.Request) Response {
 		if err != nil {
 			return BadRequest(err)
 		}
+
 		err = doProfileUpdateCluster(d, project, name, old)
 		return SmartError(err)
-
 	}
 
 	var id int64
@@ -252,8 +252,9 @@ func profilePut(d *Daemon, r *http.Request) Response {
 		if err != nil {
 			return SmartError(err)
 		}
+
 		err = notifier(func(client lxd.ContainerServer) error {
-			return client.UpdateProfile(name, profile.ProfilePut, "")
+			return client.UseProject(project).UpdateProfile(name, profile.ProfilePut, "")
 		})
 		if err != nil {
 			return SmartError(err)


More information about the lxc-devel mailing list