5
0
mirror of git://git.proxmox.com/git/pve-common.git synced 2025-01-10 09:17:37 +03:00

Fix indexed parameter conversion in API dump

this would previously skip (i.e., ignore) properties that
matched '^([a-z]+)(\d+)$' even if they were not part of an
indexed properties series (which always start with 0).

This fixes previously missing API dump occurrences of:
-smbios1
-comments6
-netmask6
-gateway6
-address6
-dns1
-dns2
-dns3
-server1
-server2
This commit is contained in:
Fabian Grünbichler 2016-04-19 11:47:54 +02:00 committed by Dietmar Maurer
parent a76028f847
commit 2c2a5fd3df

View File

@ -36,8 +36,8 @@ sub api_clone_schema {
if ($p =~ m/^([a-z]+)(\d+)$/) {
if ($2 == 0) {
$p = "$1\[n\]";
} else {
next;
} elsif (defined($d->{$1.'0'})) {
next; # only handle once for -xx0, but only if -xx0 exists
}
}
$res->{$k}->{$p} = ref($pd) ? clone($pd) : $pd;