'get target port iqns and target_portals.'

def _get_eternus_iscsi_properties(self):

    iscsi_properties_list = []
    iscsiip_list = self._get_drvcfg('EternusISCSIIP', multiple=True)
    iscsi_port = self.configuration.iscsi_port
    LOG.debug('_get_eternus_iscsi_properties,    iplist:    %s.', iscsiip_list)
    try:
        ip_endpointlist = self._enum_eternus_instance_names('FUJITSU_IPProtocolEndpoint')
    except Exception:
        msg = (_('_get_eternus_iscsi_properties,    iscsiip:    %(iscsiip)s,    EnumerateInstanceNames,    cannot    connect    to    ETERNUS.') % {'iscsiip': iscsiip_list})
        LOG.error(msg)
        raise exception.VolumeBackendAPIException(data=msg)
    for ip_endpoint in ip_endpointlist:
        try:
            ip_endpoint_instance = self._get_eternus_instance(ip_endpoint)
            ip_address = ip_endpoint_instance['IPv4Address']
            LOG.debug('_get_eternus_iscsi_properties,    instanceip:    %(ip)s,    iscsiip:    %(iscsiip)s.', {'ip': ip_address, 'iscsiip': iscsiip_list})
        except Exception:
            msg = (_('_get_eternus_iscsi_properties,    iscsiip:    %(iscsiip)s,    GetInstance,    cannot    connect    to    ETERNUS.') % {'iscsiip': iscsiip_list})
            LOG.error(msg)
            raise exception.VolumeBackendAPIException(data=msg)
        if (ip_address not in iscsiip_list):
            continue
        LOG.debug('_get_eternus_iscsi_properties,    find    iscsiip:    %(ip)s.', {'ip': ip_address})
        try:
            tcp_endpointlist = self._assoc_eternus_names(ip_endpoint, AssocClass='CIM_BindsTo', ResultClass='FUJITSU_TCPProtocolEndpoint')
        except Exception:
            msg = (_('_get_eternus_iscsi_properties,    iscsiip:    %(iscsiip)s,    AssociatorNames:    CIM_BindsTo,    cannot    connect    to    ETERNUS.') % {'iscsiip': ip_address})
            LOG.error(msg)
            raise exception.VolumeBackendAPIException(data=msg)
        for tcp_endpoint in tcp_endpointlist:
            try:
                iscsi_endpointlist = self._assoc_eternus(tcp_endpoint, AssocClass='CIM_BindsTo', ResultClass='FUJITSU_iSCSIProtocolEndpoint')
            except Exception:
                msg = (_('_get_eternus_iscsi_properties,    iscsiip:    %(iscsiip)s,    AssociatorNames:    CIM_BindsTo,    cannot    connect    to    ETERNUS.') % {'iscsiip': ip_address})
                LOG.error(msg)
                raise exception.VolumeBackendAPIException(data=msg)
            for iscsi_endpoint in iscsi_endpointlist:
                target_portal = ('%s:%s' % (ip_address, iscsi_port))
                iqn = iscsi_endpoint['Name'].split(',')[0]
                iscsi_properties_list.append((iscsi_endpoint.path, target_portal, iqn))
                LOG.debug('_get_eternus_iscsi_properties,    target_portal:    %(target_portal)s,    iqn:    %(iqn)s.', {'target_portal': target_portal, 'iqn': iqn})
    if (len(iscsi_properties_list) == 0):
        msg = (_('_get_eternus_iscsi_properties,    iscsiip    list:    %(iscsiip_list)s,    iqn    not    found.') % {'iscsiip_list': iscsiip_list})
        LOG.error(msg)
        raise exception.VolumeBackendAPIException(data=msg)
    LOG.debug('_get_eternus_iscsi_properties,    iscsi_properties_list:    %(iscsi_properties_list)s.', {'iscsi_properties_list': iscsi_properties_list})
    return iscsi_properties_list
