From a68a0345a27adc4b3d75469d621dea8f7d541251 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Thu, 9 Apr 2020 17:38:23 -0400 Subject: [PATCH] Return error in CreateVG when command or scan fails. CreateVG was not returning error even when it detected one. --- linux/lvm.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux/lvm.go b/linux/lvm.go index 1df6de8..9d8da31 100644 --- a/linux/lvm.go +++ b/linux/lvm.go @@ -208,13 +208,13 @@ func (ls *linuxLVM) CreateVG(name string, pvs ...disko.PV) (disko.VG, error) { err := runCommandSettled(cmd...) if err != nil { - return disko.VG{}, nil + return disko.VG{}, err } vgSet, err := ls.scanVGs(func(d disko.VG) bool { return true }, name) if err != nil { - return disko.VG{}, nil + return disko.VG{}, err } return vgSet[name], nil