Skip to content

Commit

Permalink
Return error in CreateVG when command or scan fails.
Browse files Browse the repository at this point in the history
CreateVG was not returning error even when it detected one.
  • Loading branch information
Scott Moser authored and rchamarthy committed Apr 9, 2020
1 parent 6591a09 commit a68a034
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions linux/lvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a68a034

Please sign in to comment.