added devicePath check for fcDisk

This commit is contained in:
Nikhil Sharma 2022-01-07 20:10:03 +05:30
parent d1a5513cb0
commit 4eaa533777

View File

@ -254,7 +254,15 @@ func (util *fcUtil) AttachDisk(b fcDiskMounter) (string, error) {
return "", err
}
return devicePath, nil
exists, err := mount.PathExists(devicePath)
if exists && err == nil {
return devicePath, nil
}
if exists == false {
return "", fmt.Errorf("device %s does not exist", devicePath)
} else {
return "", err
}
}
// DetachDisk removes scsi device file such as /dev/sdX from the node.