[lxc-devel] [lxd/master] lxd/network/ovn: Use snap path

stgraber on Github lxc-bot at linuxcontainers.org
Tue Aug 18 21:48:40 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 354 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20200818/aa6e73b6/attachment.bin>
-------------- next part --------------
From 5a3553377d5c066d94852b9ce1b1d9969fd00a7a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Tue, 18 Aug 2020 17:42:52 -0400
Subject: [PATCH] lxd/network/ovn: Use snap path
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: St├ęphane Graber <stgraber at ubuntu.com>
---
 lxd/network/openvswitch/ovn.go | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lxd/network/openvswitch/ovn.go b/lxd/network/openvswitch/ovn.go
index 3b63fb773a..656ada439d 100644
--- a/lxd/network/openvswitch/ovn.go
+++ b/lxd/network/openvswitch/ovn.go
@@ -112,7 +112,12 @@ func (o *OVN) getNorthboundDB() string {
 
 // nbctl executes ovn-nbctl with arguments to connect to wrapper's northbound database.
 func (o *OVN) nbctl(args ...string) (string, error) {
-	return shared.RunCommand("ovn-nbctl", append([]string{"--db", o.getNorthboundDB()}, args...)...)
+	dbAddr := o.getNorthboundDB()
+	if strings.HasPrefix(dbAddr, "unix:") {
+		dbAddr = fmt.Sprintf("unix:%s", shared.HostPathFollow(strings.TrimPrefix(dbAddr, "unix:")))
+	}
+
+	return shared.RunCommand("ovn-nbctl", append([]string{"--db", dbAddr}, args...)...)
 }
 
 // LogicalRouterAdd adds a named logical router.


More information about the lxc-devel mailing list