added devicePath check for fcDisk
This commit is contained in:
		@@ -254,8 +254,16 @@ func (util *fcUtil) AttachDisk(b fcDiskMounter) (string, error) {
 | 
			
		||||
		return "", err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	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.
 | 
			
		||||
func (util *fcUtil) DetachDisk(c fcDiskUnmounter, devicePath string) error {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user