os-brick _get_hba_channel_scsi_target always return empty
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
os-brick |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Existing code of
https:/
cmd = 'grep %(wwnn)s %(path)
cmd output will return the matching wwnn
[~]# grep 5005076802232ade /sys/class/
0x5005076802232ade
But the expected output is the matching file path returned, to get the clt.
return [line.split(
Proposed fix:
cmd should be executed using grep -l instead of grep
[ ~]# grep -l 5005076802232ade /sys/class/
/sys/class/
[~]#
Used the master branch of os-brick.
affects: | cinder → os-brick |
Reviewed: https:/ /review. openstack. org/520052 /git.openstack. org/cgit/ openstack/ os-brick/ commit/ ?id=4ee404466d3 f2ced8bfdfb1892 7ef19a27967952
Committed: https:/
Submitter: Zuul
Branch: master
commit 4ee404466d3f2ce d8bfdfb18927ef1 9a27967952
Author: Gorka Eguileor <email address hidden>
Date: Wed Nov 8 21:03:08 2017 +0100
Fixing FC scanning
Current FC tries to limit the scanning range by detecting the target and
channel, unfortunately this code has a good number of implementation
issues:
- Matching uses local WWNN instead of target's WWPN.
- Not using a shell to run the command, so the * glob won't expand.
- Not using -l on grep command to list file names instead of contents.
- Not making the search case insensitive.
This patch fixes all these issues by using the target's WWPNs instead
-taking into account FC Zone/Access control information if present- and
supporting both possible connection information formats for the WWPNs
(single value or list of values).
Rescan tests have been modified to adhere to unit tests best practices,
where each test case only tests the specific code in the method under
test and mocks everything else.
Closes-Bug: #1664653 4399c30cd90f326 829e839ec02
Closes-Bug: #1684996
Closes-Bug: #1687607
Change-Id: Ib539f6a3652bab