[pve-devel] [PATCH container] api: network: get interfaces from containers

Lukas Wagner l.wagner at proxmox.com
Tue Apr 18 11:41:56 CEST 2023


On 4/18/23 11:31, Leo Nunner wrote:
> +    foreach my $interface ($config->@*) {
> +	my $obj = { name => $interface->{ifname} };
> +	foreach my $ip ($interface->{addr_info}->@*) {
> +	    $obj->{$ip->{family}} = $ip->{local} . "/" . $ip->{prefixlen};
> +	}
> +	$obj->{hwaddr} = $interface->{address};
> +	push @$res, $obj
> +    }

Nit, according to our style guide [1], `for` is to be preferred over `foreach`.

[1] https://pve.proxmox.com/wiki/Perl_Style_Guide#Perl_syntax_choices

-- 
- Lukas





More information about the pve-devel mailing list