From 1e9d24ac77a811f899af28c731e5219c04102898 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Wed, 13 Oct 2021 18:07:08 +0200 Subject: [PATCH] ceph: print the c-v output when inventory command fails MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hopefully, this will give us more hints when a failure occurs. Signed-off-by: Sébastien Han --- pkg/util/sys/device.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/util/sys/device.go b/pkg/util/sys/device.go index f664de46b468..5cbc2da11d95 100644 --- a/pkg/util/sys/device.go +++ b/pkg/util/sys/device.go @@ -407,13 +407,13 @@ func inventoryDevice(executor exec.Executor, devicePath string) (CephVolumeInven args := []string{"inventory", "--format", "json", devicePath} inventory, err := executor.ExecuteCommandWithOutput("ceph-volume", args...) if err != nil { - return CVInventory, fmt.Errorf("failed to execute ceph-volume inventory on disk %q. %v", devicePath, err) + return CVInventory, fmt.Errorf("failed to execute ceph-volume inventory on disk %q. %s. %v", devicePath, inventory, err) } bInventory := []byte(inventory) err = json.Unmarshal(bInventory, &CVInventory) if err != nil { - return CVInventory, fmt.Errorf("error unmarshalling json data coming from ceph-volume inventory %q. %v", devicePath, err) + return CVInventory, fmt.Errorf("failed to unmarshal json data coming from ceph-volume inventory %q. %q. %v", devicePath, inventory, err) } return CVInventory, nil