'Method adds same networks with replaced name on network id.
This method is used only for resolving attributes.'

def _extend_networks(self, networks):

    nets = copy.deepcopy(networks)
    client_plugin = self.client_plugin('neutron')
    for key in list(nets.keys()):
        try:
            net_id = client_plugin.find_resourceid_by_name_or_id('network', key)
        except Exception as ex:
            if (client_plugin.is_not_found(ex) or client_plugin.is_no_unique(ex)):
                net_id = None
            else:
                raise
        if net_id:
            nets[net_id] = nets[key]
    return nets
