#NEWLINE# def _iscsi_discover_target( self , data ) : #NEWLINE# #INDENT# 'Get iSCSI target, rescanning the HBA if necessary.' #NEWLINE# target_portal = data [ 'target_portal' ] #NEWLINE# target_iqn = data [ 'target_iqn' ] #NEWLINE# LOG . debug ( 'Discovering iSCSI target %(target_iqn)s from %(target_portal)s.' , { #NEWLINE# #INDENT# 'target_iqn' : target_iqn , #NEWLINE# 'target_portal' : target_portal , #NEWLINE# #UNINDENT# } ) #NEWLINE# ( device_name , uuid ) = self . _iscsi_get_target ( data ) #NEWLINE# if device_name : #NEWLINE# #INDENT# LOG . debug ( 'Storage target found. No need to discover' ) #NEWLINE# return ( device_name , uuid ) #NEWLINE# #UNINDENT# self . _iscsi_rescan_hba ( target_portal ) #NEWLINE# ( device_name , uuid ) = self . _iscsi_get_target ( data ) #NEWLINE# if device_name : #NEWLINE# #INDENT# LOG . debug ( 'Discovered iSCSI target %(target_iqn)s from %(target_portal)s.' , { #NEWLINE# #INDENT# 'target_iqn' : target_iqn , #NEWLINE# 'target_portal' : target_portal , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# LOG . debug ( 'Unable to discovered iSCSI target %(target_iqn)s from %(target_portal)s.' , { #NEWLINE# #INDENT# 'target_iqn' : target_iqn , #NEWLINE# 'target_portal' : target_portal , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# return ( device_name , uuid )