Patrick East 50ef90251c FC fix for scanning only connected HBA's
When provided an initiator target map and attempting a rescan
in LinuxFibreChannel.rescan_hosts(...) if the system doesn't
yet have /sys/class/fc_host/fc_transport/** directories then
we can get into a position where the call to
LinuxFibreChannel._get_hba_channel_scsi_target will return
"None". Later on when we iterate through "process" and attempt
to iterate on "cts" this will raise an exception. We used to
fall back to a wildcard scan, and still do if no target map
is provided. This fix will do just that, for cases where we
don't have enough other information we just use wildcards.

In testing it seems like this happens on first-time connections
to a target after the ACLs have been setup on the arrays for
the initiator. After that we can get the HBA channel and SCSI
target with the grep call in _get_hba_channel_scsi_target

Change-Id: Ifd79b055882bb513fccf21d584baaeb1d60e67f2
Closes-Bug: #1774283
2018-06-01 18:23:09 -07:00
..
2017-12-01 23:06:15 +02:00