'return target portid.'

def _get_target_port(self):

    LOG.debug('_get_target_port,    protocol:    %s.', self.protocol)
    target_portlist = []
    if (self.protocol == 'fc'):
        prtcl_endpoint = 'FUJITSU_SCSIProtocolEndpoint'
        connection_type = 2
    elif (self.protocol == 'iSCSI'):
        prtcl_endpoint = 'FUJITSU_iSCSIProtocolEndpoint'
        connection_type = 7
    try:
        tgtportlist = self._enum_eternus_instances(prtcl_endpoint)
    except Exception:
        msg = _('_get_target_port,    EnumerateInstances,    cannot    connect    to    ETERNUS.')
        LOG.error(msg)
        raise exception.VolumeBackendAPIException(data=msg)
    for tgtport in tgtportlist:
        if (tgtport['ConnectionType'] != connection_type):
            continue
        if ((tgtport['RAMode'] & 123) != 0):
            continue
        if ('SCGroupNo' in tgtport):
            continue
        target_portlist.append(tgtport)
        LOG.debug('_get_target_port,    connection    type:    %(cont)s,    ramode:    %(ramode)s.', {'cont': tgtport['ConnectionType'], 'ramode': tgtport['RAMode']})
    LOG.debug('_get_target_port,    target    port:    %(target_portid)s.', {'target_portid': target_portlist})
    if (len(target_portlist) == 0):
        msg = (_('_get_target_port,    protcol:    %(protocol)s,    target_port    not    found.') % {'protocol': self.protocol})
        LOG.error(msg)
        raise exception.VolumeBackendAPIException(data=msg)
    LOG.debug('_get_target_port,    ret:    %s.', target_portlist)
    return target_portlist
