public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Lukas Wagner <l.wagner@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
	Leo Nunner <l.nunner@proxmox.com>
Subject: Re: [pve-devel] [PATCH container] api: network: get interfaces from containers
Date: Tue, 18 Apr 2023 11:41:56 +0200	[thread overview]
Message-ID: <08cc2495-8238-46f2-4730-24d048f9edf2@proxmox.com> (raw)
In-Reply-To: <20230418093144.61317-2-l.nunner@proxmox.com>

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




  reply	other threads:[~2023-04-18  9:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-18  9:31 [pve-devel] [PATCH container manager] Show dynamic container IPs in GUI Leo Nunner
2023-04-18  9:31 ` [pve-devel] [PATCH container] api: network: get interfaces from containers Leo Nunner
2023-04-18  9:41   ` Lukas Wagner [this message]
2023-04-18  9:31 ` [pve-devel] [PATCH manager] lxc: show dynamically assigned IPs in network tab Leo Nunner
2023-04-18  9:47   ` Lukas Wagner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=08cc2495-8238-46f2-4730-24d048f9edf2@proxmox.com \
    --to=l.wagner@proxmox.com \
    --cc=l.nunner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal