Code cleanup in initiator/linuxfc.py
Removed some functionally superfluous code in functions calling LinuxFibreChannel.get_fc_hbas. Relies on said function to return an iterable. Change-Id: I404a3bda8bea42401b8f98d7685a176081267415
This commit is contained in:
parent
eca5a7f2e0
commit
2948c810f6
|
@ -139,8 +139,6 @@ class LinuxFibreChannel(linuxscsi.LinuxSCSI):
|
||||||
# Note(walter-boring) modern Linux kernels contain the FC HBA's in /sys
|
# Note(walter-boring) modern Linux kernels contain the FC HBA's in /sys
|
||||||
# and are obtainable via the systool app
|
# and are obtainable via the systool app
|
||||||
hbas = self.get_fc_hbas()
|
hbas = self.get_fc_hbas()
|
||||||
if not hbas:
|
|
||||||
return []
|
|
||||||
|
|
||||||
hbas_info = []
|
hbas_info = []
|
||||||
for hba in hbas:
|
for hba in hbas:
|
||||||
|
@ -162,11 +160,10 @@ class LinuxFibreChannel(linuxscsi.LinuxSCSI):
|
||||||
hbas = self.get_fc_hbas()
|
hbas = self.get_fc_hbas()
|
||||||
|
|
||||||
wwpns = []
|
wwpns = []
|
||||||
if hbas:
|
for hba in hbas:
|
||||||
for hba in hbas:
|
if hba['port_state'] == 'Online':
|
||||||
if hba['port_state'] == 'Online':
|
wwpn = hba['port_name'].replace('0x', '')
|
||||||
wwpn = hba['port_name'].replace('0x', '')
|
wwpns.append(wwpn)
|
||||||
wwpns.append(wwpn)
|
|
||||||
|
|
||||||
return wwpns
|
return wwpns
|
||||||
|
|
||||||
|
@ -176,15 +173,12 @@ class LinuxFibreChannel(linuxscsi.LinuxSCSI):
|
||||||
# Note(walter-boring) modern Linux kernels contain the FC HBA's in /sys
|
# Note(walter-boring) modern Linux kernels contain the FC HBA's in /sys
|
||||||
# and are obtainable via the systool app
|
# and are obtainable via the systool app
|
||||||
hbas = self.get_fc_hbas()
|
hbas = self.get_fc_hbas()
|
||||||
if not hbas:
|
|
||||||
return []
|
|
||||||
|
|
||||||
wwnns = []
|
wwnns = []
|
||||||
if hbas:
|
for hba in hbas:
|
||||||
for hba in hbas:
|
if hba['port_state'] == 'Online':
|
||||||
if hba['port_state'] == 'Online':
|
wwnn = hba['node_name'].replace('0x', '')
|
||||||
wwnn = hba['node_name'].replace('0x', '')
|
wwnns.append(wwnn)
|
||||||
wwnns.append(wwnn)
|
|
||||||
|
|
||||||
return wwnns
|
return wwnns
|
||||||
|
|
||||||
|
@ -194,8 +188,6 @@ class LinuxFibreChannelS390X(LinuxFibreChannel):
|
||||||
"""Get Fibre Channel WWNs and device paths from the system, if any."""
|
"""Get Fibre Channel WWNs and device paths from the system, if any."""
|
||||||
|
|
||||||
hbas = self.get_fc_hbas()
|
hbas = self.get_fc_hbas()
|
||||||
if not hbas:
|
|
||||||
return []
|
|
||||||
|
|
||||||
hbas_info = []
|
hbas_info = []
|
||||||
for hba in hbas:
|
for hba in hbas:
|
||||||
|
|
Loading…
Reference in New Issue