[pve-devel] applied: [PATCH container] config list helper: fix return type of vmid for container index API enpoint

Fabian Grünbichler f.gruenbichler at proxmox.com
Thu Apr 11 15:29:18 CEST 2024


On December 5, 2023 12:35 pm, Fiona Ebner wrote:
> 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 at 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
> 
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
> 
> 
> 




More information about the pve-devel mailing list