The following pull request was submitted through Github. It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/4981
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 66327edca6a283a73a1c1c403351ca23fb21fd77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= <[email protected]> Date: Sun, 26 Aug 2018 19:37:22 -0400 Subject: [PATCH 1/2] client: Avoid err == nil pattern MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber <[email protected]> --- client/util.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/util.go b/client/util.go index 784aab9efe..3826c138e1 100644 --- a/client/util.go +++ b/client/util.go @@ -110,9 +110,9 @@ func remoteOperationError(msg string, errors map[string]error) error { } // Check if successful - if err == nil { - return nil + if err != nil { + return fmt.Errorf("%s: %s", msg, err) } - return fmt.Errorf("%s: %s", msg, err) + return nil } From b3b802b41c22d009325a7d2c2a37b5b8d168ab58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= <[email protected]> Date: Sun, 26 Aug 2018 20:37:01 -0400 Subject: [PATCH 2/2] lxd/profiles: Don't list snapshots in UsedBy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber <[email protected]> --- lxd/db/profiles.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lxd/db/profiles.go b/lxd/db/profiles.go index f6e55de54b..b990b0b06f 100644 --- a/lxd/db/profiles.go +++ b/lxd/db/profiles.go @@ -237,7 +237,7 @@ func (c *Cluster) ProfileContainersGet(profile string) ([]string, error) { q := `SELECT containers.name FROM containers JOIN containers_profiles ON containers.id == containers_profiles.container_id JOIN profiles ON containers_profiles.profile_id == profiles.id - WHERE profiles.name == ?` + WHERE profiles.name == ? AND containers.type == 0` results := []string{} inargs := []interface{}{profile}
_______________________________________________ lxc-devel mailing list [email protected] http://lists.linuxcontainers.org/listinfo/lxc-devel
