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

Wolfgang Bumiller w.bumiller at proxmox.com
Wed Jul 13 14:13:26 CEST 2016


On Wed, Jul 13, 2016 at 10:18:58AM +0200, Dominik Csapak wrote:
> 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}) {

We could actually save a hash lookup there and make this an 'else', no?

> +	    delete $ifaces->{weave}; # do not list weave device
>  	}
>  
>  	return PVE::RESTHandler::hash_to_array($ifaces, 'iface');
> -- 
> 2.1.4
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
> 




More information about the pve-devel mailing list