[lxc-devel] [lxd/master] lxd/storage/ceph: Suppport alternate conf syntax

stgraber on Github lxc-bot at linuxcontainers.org
Fri Apr 17 02:06:04 UTC 2020


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/20200416/1d1382eb/attachment.bin>
-------------- next part --------------
From a8840dbbd9dc02adb0b4505bc77844e99b454de8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Thu, 16 Apr 2020 22:05:26 -0400
Subject: [PATCH] lxd/storage/ceph: Suppport alternate conf syntax
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Closes #7208

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 lxd/device/device_utils_disk.go            | 2 +-
 lxd/storage/drivers/driver_cephfs_utils.go | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lxd/device/device_utils_disk.go b/lxd/device/device_utils_disk.go
index 43d05347e1..8490bb144f 100644
--- a/lxd/device/device_utils_disk.go
+++ b/lxd/device/device_utils_disk.go
@@ -192,7 +192,7 @@ func cephFsConfig(clusterName string, userName string) ([]string, string, error)
 			continue
 		}
 
-		if strings.HasPrefix(line, "mon_host") {
+		if strings.HasPrefix(line, "mon_host") || strings.HasPrefix(line, "mon-host") || strings.HasPrefix(line, "mon host") {
 			fields := strings.SplitN(line, "=", 2)
 			if len(fields) < 2 {
 				continue
diff --git a/lxd/storage/drivers/driver_cephfs_utils.go b/lxd/storage/drivers/driver_cephfs_utils.go
index 31b5d1d572..ada9f2e5a8 100644
--- a/lxd/storage/drivers/driver_cephfs_utils.go
+++ b/lxd/storage/drivers/driver_cephfs_utils.go
@@ -40,7 +40,7 @@ func (d *cephfs) getConfig(clusterName string, userName string) ([]string, strin
 			continue
 		}
 
-		if strings.HasPrefix(line, "mon_host") {
+		if strings.HasPrefix(line, "mon_host") || strings.HasPrefix(line, "mon-host") || strings.HasPrefix(line, "mon host") {
 			fields := strings.SplitN(line, "=", 2)
 			if len(fields) < 2 {
 				continue


More information about the lxc-devel mailing list