Skip to content

Commit

Permalink
[Issue #1096] - Put code back that returned device if path set
Browse files Browse the repository at this point in the history
- to fix unit test

Signed-off-by: Eddie Pavkovic <[email protected]>
  • Loading branch information
eddiepavkovic committed Feb 26, 2024
1 parent 481eeb6 commit dfacddf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/base/linuxutils/lsblk/lsblk.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,13 @@ func (l *LSBLK) GetBlockDevices(device string) ([]BlockDevice, error) {
// Receives an instance of drivecrd.Drive struct
// Returns drive's path based on provided drivecrd.Drive or error if something went wrong
func (l *LSBLK) SearchDrivePath(drive *api.Drive) (string, error) {
device := ""
// device path might be already set by hwmgr
device := drive.Path
if device != "" {
return device, nil
}

device = ""
// try to find it with lsblk
lsblkOut, err := l.GetBlockDevices("")
if err != nil {
Expand Down

0 comments on commit dfacddf

Please sign in to comment.