public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH container] config list helper: fix return type of vmid for container index API enpoint
@ 2023-12-05 11:35 Fiona Ebner
  2024-04-11 11:57 ` Fiona Ebner
  2024-04-11 13:29 ` [pve-devel] applied: " Fabian Grünbichler
  0 siblings, 2 replies; 3+ messages in thread
From: Fiona Ebner @ 2023-12-05 11:35 UTC (permalink / raw)
  To: pve-devel

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





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-04-11 13:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-05 11:35 [pve-devel] [PATCH container] config list helper: fix return type of vmid for container index API enpoint Fiona Ebner
2024-04-11 11:57 ` Fiona Ebner
2024-04-11 13:29 ` [pve-devel] applied: " Fabian Grünbichler

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