'Get target iSCSI params, including iqn, IP.'

def get_iscsi_params(self, connector):

    initiator = connector['initiator']
    multipath = connector['multipath']
    target_ips = []
    target_iqns = []
    temp_tgt_ips = []
    portgroup = None
    portgroup_id = None
    if multipath:
        for ini in self.iscsi_info:
            if (ini['Name'] == initiator):
                portgroup = ini.get('TargetPortGroup')
        if portgroup:
            portgroup_id = self.get_tgt_port_group(portgroup)
            temp_tgt_ips = self._get_tgt_ip_from_portgroup(portgroup_id)
            valid_port_info = self._get_tgt_port_ip_from_rest()
            valid_tgt_ips = valid_port_info
            for ip in temp_tgt_ips:
                if (ip in valid_tgt_ips):
                    target_ips.append(ip)
            if (not target_ips):
                msg = (_('get_iscsi_params:    No    valid    port    in    portgroup.    portgroup_id:    %(id)s,    please    check    it    on    storage.') % {'id': portgroup_id})
                LOG.error(msg)
                raise exception.VolumeBackendAPIException(data=msg)
        else:
            target_ips = self._get_target_ip(initiator)
    else:
        target_ips = self._get_target_ip(initiator)
    if ('remote_target_ip' in connector):
        target_ips.append(connector['remote_target_ip'])
    LOG.info('Get    the    default    ip:    %s.', target_ips)
    for ip in target_ips:
        target_iqn = self._get_tgt_iqn_from_rest(ip)
        if (not target_iqn):
            target_iqn = self._get_tgt_iqn(ip)
        if target_iqn:
            target_iqns.append(target_iqn)
    return (target_iqns, target_ips, portgroup_id)
