lstape: fix to prevent error messages if there are non-zfcp SCSI devices

Assume "N/A" for non-zfcp SCSI devices, such as iSCSI or virtio-scsi-ccw,
to not erroneously access absent zfcp-specific sysfs attributes.

Signed-off-by: Steffen Maier <maier@linux.ibm.com>
Reviewed-by: Hendrik Brueckner <brueckner@linux.ibm.com>
Reviewed-by: Jens Remus <jremus@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Steffen Maier
2018-06-15 20:26:13 +02:00
committed by Jan Höppner
parent eba744a25e
commit 4cf8f5f46c

View File

@@ -335,9 +335,13 @@ function SysfsCreateListSCSI()
$STATE
if $VERBOSE; then
HBA_ID="N/A"
[ -r $SCSI_DEV/hba_id ] && HBA_ID=$(cat $SCSI_DEV/hba_id)
WWPN="N/A"
[ -r $SCSI_DEV/wwpn ] && WWPN=$(cat $SCSI_DEV/wwpn)
printf "$SCSIVFORMAT" \
$(cat $SCSI_DEV/hba_id) \
$(cat $SCSI_DEV/wwpn) \
"$HBA_ID" \
"$WWPN" \
$TAPE_SERIAL
fi
done