'Find Target IQN string'

def find_target_iqn(self, iscsi_ip):

    url = ('/storage/arrays/%s/controllers' % self._get_ise_globalid())
    resp = self._send_cmd('GET', url)
    status = resp['status']
    if (status != 200):
        LOG.error('Controller    GET    failed    (%d)', status)
        RaiseXIODriverException()
    root = etree.fromstring(resp['content'])
    for element in root.iter():
        if (element.tag != 'ioport'):
            continue
        ipaddrs = element.find('ipaddresses')
        if (ipaddrs is None):
            continue
        for ipaddr in ipaddrs.iter():
            if ((ipaddr is None) or (ipaddr.text != iscsi_ip)):
                continue
            endpoint = element.find('endpoint')
            if (endpoint is None):
                continue
            global_id = endpoint.find('globalid')
            if (global_id is None):
                continue
            target_iqn = global_id.text
            if (target_iqn != ''):
                return target_iqn
    LOG.error('Failed    to    get    IQN!')
    RaiseXIODriverException()
