'Get discovery ip.'

def _get_discovery_ip(self, netconfig):

    subnet_label = self.configuration.nimble_subnet_label
    LOG.debug('subnet_label    used    %(netlabel)s,    netconfig    %(netconf)s', {'netlabel': subnet_label, 'netconf': netconfig})
    ret_discovery_ip = ''
    for subnet in netconfig['subnet_list']:
        LOG.info('Exploring    array    subnet    label    %s', subnet['label'])
        if (subnet_label == '*'):
            if (subnet['type'] == SM_SUBNET_DATA):
                LOG.info('Discovery    ip    %(disc_ip)s    is    used    on    data    subnet    %(net_label)s', {'disc_ip': subnet['discovery_ip'], 'net_label': subnet['label']})
                return subnet['discovery_ip']
            elif (subnet['type'] == SM_SUBNET_MGMT_PLUS_DATA):
                LOG.info('Discovery    ip    %(disc_ip)s    is    found    on    mgmt+data    subnet    %(net_label)s', {'disc_ip': subnet['discovery_ip'], 'net_label': subnet['label']})
                ret_discovery_ip = subnet['discovery_ip']
        elif (subnet_label == subnet['label']):
            LOG.info('Discovery    ip    %(disc_ip)s    is    used    on    subnet    %(net_label)s', {'disc_ip': subnet['discovery_ip'], 'net_label': subnet['label']})
            return subnet['discovery_ip']
    if ret_discovery_ip:
        LOG.info('Discovery    ip    %s    is    used    on    mgmt+data    subnet', ret_discovery_ip)
        return ret_discovery_ip
    else:
        raise NimbleDriverException(_('No    suitable    discovery    ip    found'))
