[lxc-devel] [lxd/master] lxd/storage/lvm: Log actual error

stgraber on Github lxc-bot at linuxcontainers.org
Tue Aug 13 20:00:52 UTC 2019


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/20190813/2e3edc88/attachment.bin>
-------------- next part --------------
From f43b20f9f5fb6df15d21d2fbdc496d17254e0f5d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Tue, 13 Aug 2019 16:00:20 -0400
Subject: [PATCH] lxd/storage/lvm: Log actual error
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/storage_lvm_utils.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lxd/storage_lvm_utils.go b/lxd/storage_lvm_utils.go
index 80ea742724..c35e66bcca 100644
--- a/lxd/storage_lvm_utils.go
+++ b/lxd/storage_lvm_utils.go
@@ -596,7 +596,7 @@ func lvmLvIsWritable(lvName string) (bool, error) {
 func storageVGActivate(lvmVolumePath string) error {
 	output, err := shared.TryRunCommand("vgchange", "-ay", lvmVolumePath)
 	if err != nil {
-		return fmt.Errorf("could not activate volume group \"%s\": %s", lvmVolumePath, output)
+		return fmt.Errorf("could not activate volume group \"%s\": %s: %s", lvmVolumePath, output, err)
 	}
 
 	return nil
@@ -605,7 +605,7 @@ func storageVGActivate(lvmVolumePath string) error {
 func storageLVActivate(lvmVolumePath string) error {
 	output, err := shared.TryRunCommand("lvchange", "-ay", lvmVolumePath)
 	if err != nil {
-		return fmt.Errorf("could not activate logival volume \"%s\": %s", lvmVolumePath, output)
+		return fmt.Errorf("could not activate logival volume \"%s\": %s: %s", lvmVolumePath, output, err)
 	}
 
 	return nil


More information about the lxc-devel mailing list