'get ip address of iSCSI interface.'

def _get_iscsi_ip_addrs(self):

    LOG.debug('enter:    _get_iscsi_ip_addrs')
    cmd = ['svcinfo', 'lsportip']
    generator = self._port_conf_generator(cmd)
    header = next(generator, None)
    if (not header):
        return
    for key in self._storage_nodes:
        if (self._storage_nodes[key]['config_node'] == 'yes'):
            node = self._storage_nodes[key]
            break
    if (node is None):
        msg = _('No    config    node    found.')
        LOG.error(msg)
        raise exception.VolumeBackendAPIException(data=msg)
    for port_data in generator:
        try:
            port_ipv4 = port_data['IP_address']
            port_ipv6 = port_data['IP_address_6']
            state = port_data['state']
            speed = port_data['speed']
        except KeyError:
            self._handle_keyerror('lsportip', header)
        if ((port_ipv4 == self.configuration.iscsi_ip_address) and (port_data['id'] == six.text_type(self.configuration.flashsystem_iscsi_portid))):
            if (state not in ('configured', 'online')):
                msg = (_('State    of    node    is    wrong.    Current    state    is    %s.') % state)
                LOG.error(msg)
                raise exception.VolumeBackendAPIException(data=msg)
            if ((state in ('configured', 'online')) and (speed != 'NONE')):
                if port_ipv4:
                    node['ipv4'].append(port_ipv4)
                if port_ipv6:
                    node['ipv6'].append(port_ipv6)
                break
    if (not (len(node['ipv4']) or len(node['ipv6']))):
        msg = _('No    ip    address    found.')
        LOG.error(msg)
        raise exception.VolumeBackendAPIException(data=msg)
    LOG.debug('leave:    _get_iscsi_ip_addrs')
