'Get iSCSI target, rescanning the HBA if necessary.'

def _iscsi_discover_target(self, data):

    target_portal = data['target_portal']
    target_iqn = data['target_iqn']
    LOG.debug('Discovering    iSCSI    target    %(target_iqn)s    from    %(target_portal)s.', {'target_iqn': target_iqn, 'target_portal': target_portal})
    (device_name, uuid) = self._iscsi_get_target(data)
    if device_name:
        LOG.debug('Storage    target    found.    No    need    to    discover')
        return (device_name, uuid)
    self._iscsi_rescan_hba(target_portal)
    (device_name, uuid) = self._iscsi_get_target(data)
    if device_name:
        LOG.debug('Discovered    iSCSI    target    %(target_iqn)s    from    %(target_portal)s.', {'target_iqn': target_iqn, 'target_portal': target_portal})
    else:
        LOG.debug('Unable    to    discovered    iSCSI    target    %(target_iqn)s    from    %(target_portal)s.', {'target_iqn': target_iqn, 'target_portal': target_portal})
    return (device_name, uuid)
