Browse Source

gluon-mesh-vpn-fastd: use delete_all instead of foreach to delete the old peers

Matthias Schiffer 10 years ago
parent
commit
f9cc73187f

+ 4 - 6
package/gluon-mesh-vpn-fastd/files/lib/gluon/upgrade/mesh-vpn-fastd/invariant/010-mesh-vpn-fastd

@@ -39,12 +39,10 @@ c:section('fastd', 'peer_group', 'mesh_vpn_backbone',
 	  }
 )
 
-c:foreach('fastd', 'peer',
-  function(peer)
-    if peer.net == 'mesh_vpn' and peer.group == 'mesh_vpn_backbone' then
-      c:delete('fastd', peer['.name'])
-    end
-  end
+c:delete_all('fastd', 'peer',
+	     function(peer)
+	       return peer.net == 'mesh_vpn' and peer.group == 'mesh_vpn_backbone'
+	     end
 )
 
 for name, config in pairs(site.fastd_mesh_vpn.backbone.peers) do