From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH container] config list helper: fix return type of vmid for container index API enpoint
Date: Tue, 5 Dec 2023 12:35:32 +0100 [thread overview]
Message-ID: <20231205113532.58166-1-f.ebner@proxmox.com> (raw)
The schema declares it to be an integer. Done in the config_list()
helper, to ensure consistency for the following existing code in
vmstatus():
> my $list = $opt_vmid ? { $opt_vmid => { type => 'lxc', vmid => int($opt_vmid) }} : config_list();
Should not cause any issues for other callers of the helper.
Reported in the community forum:
https://forum.proxmox.com/threads/137628/
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
src/PVE/LXC.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index 7883cfb..4fb4ef2 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -69,7 +69,7 @@ sub config_list {
my $d = $ids->{$vmid};
next if !$d->{node} || $d->{node} ne $nodename;
next if !$d->{type} || $d->{type} ne 'lxc';
- $res->{$vmid} = { type => 'lxc', vmid => $vmid };
+ $res->{$vmid} = { type => 'lxc', vmid => int($vmid) };
}
return $res;
}
--
2.39.2
next reply other threads:[~2023-12-05 11:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-05 11:35 Fiona Ebner [this message]
2024-04-11 11:57 ` Fiona Ebner
2024-04-11 13:29 ` [pve-devel] applied: " Fabian Grünbichler
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=20231205113532.58166-1-f.ebner@proxmox.com \
--to=f.ebner@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