[pve-devel] [PATCH manager] filter weave interfaces except for any_bridge type

Dominik Csapak d.csapak at proxmox.com
Wed Jul 13 10:18:58 CEST 2016


since we only want to show this when selecting a bridge
to add to a vm, not in the host network configuration

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 PVE/API2/Network.pm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/PVE/API2/Network.pm b/PVE/API2/Network.pm
index 9225686..9165bab 100644
--- a/PVE/API2/Network.pm
+++ b/PVE/API2/Network.pm
@@ -202,9 +202,11 @@ __PACKAGE__->register_method({
 		my $type = $ifaces->{$k}->{type};
 		my $match =  ($param->{type} eq $type) || (
 		    ($param->{type} eq 'any_bridge') &&
-		    ($type eq 'bridge' || $type eq 'OVSBridge'));
+		    ($type eq 'bridge' || $type eq 'OVSBridge' || $type eq 'weave'));
 		delete $ifaces->{$k} if !$match;
 	    }
+	} elsif ($ifaces->{weave}) {
+	    delete $ifaces->{weave}; # do not list weave device
 	}
 
 	return PVE::RESTHandler::hash_to_array($ifaces, 'iface');
-- 
2.1.4





More information about the pve-devel mailing list