func BlockDevicePath(device BlockDevice) (string, error) {
	if device.WWN != "" {
		return diskByWWN + device.WWN, nil
	}
	if device.HardwareId != "" {
		return path.Join(diskByID, device.HardwareId), nil
	}
	if len(device.DeviceLinks) > 0 {
		// return the first device link in the list
		return device.DeviceLinks[0], nil
	}
	if device.UUID != "" {
		return path.Join(diskByUUID, device.UUID), nil
	}
	if device.DeviceName != "" {
		return path.Join(diskByDeviceName, device.DeviceName), nil
	}
	return "", errors.Errorf("could not determine path for block device")
}
// BlockDevicePath returns the path to a block device, or an error if a path
// cannot be determined. The path is based on the hardware ID, if available;
// the first value in device.DeviceLinks, if non-empty; otherwise the device
// name.
BlockDevicePath returns the path to a block device, or an error if a path
cannot be determined. The path is based on the hardware ID, if available;
the first value in device.DeviceLinks, if non-empty; otherwise the device
name.
// BlockDevicePath returns the path to a block device or an error if a path // cannot be determined . The path is based on the hardware ID if available ; // the first value in device . DeviceLinks if non - empty ; otherwise the device // name .
func BlockDevicePath(device BlockDevice) (string, error) {
	if device.WWN != "" {
		return diskByWWN + device.WWN, nil
	}
	if device.HardwareId != "" {
		return path.Join(diskByID, device.HardwareId), nil
	}
	if len(device.DeviceLinks) > 0 {
		return device.DeviceLinks[0], nil
	}
	if device.UUID != "" {
		return path.Join(diskByUUID, device.UUID), nil
	}
	if device.DeviceName != "" {
		return path.Join(diskByDeviceName, device.DeviceName), nil
	}
	return "", errors.Errorf("could not determine path for block device")
}
func BlockDevicePath ( device BlockDevice ) ( string , error ) { if device . WWN != " " { return diskByWWN + device . WWN , nil } if device . HardwareId != " " { return path . Join ( diskByID , device . HardwareId ) , nil } if len ( device . DeviceLinks ) > 0 { return device . DeviceLinks [ 0 ] , nil } if device . UUID != " " { return path . Join ( diskByUUID , device . UUID ) , nil } if device . DeviceName != " " { return path . Join ( diskByDeviceName , device . DeviceName ) , nil } return " " , errors . Errorf ( " " ) }
BlockDevicePath returns the path to a block device, or an error if a path
cannot be determined.
BlockDevicePath returns the path to a block device or an error if a path cannot be determined .
// return the first device link in the list