Skip to content

Commit

Permalink
Merge pull request #8973 from rook/mergify/bp/release-1.7/pr-8971
Browse files Browse the repository at this point in the history
ceph: print the c-v output when inventory command fails (backport #8971)
  • Loading branch information
mergify[bot] committed Oct 13, 2021
2 parents ba77f9f + 6d45abe commit 70390d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/util/sys/device.go
Expand Up @@ -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
Expand Down

0 comments on commit 70390d1

Please sign in to comment.