From 2c2a5fd3df9c12f69aa1e8e36f4badd4fde92458 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fabian=20Gr=C3=BCnbichler?= Date: Tue, 19 Apr 2016 11:47:54 +0200 Subject: [PATCH] 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 --- src/PVE/RESTHandler.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PVE/RESTHandler.pm b/src/PVE/RESTHandler.pm index 6799fde..ca3f99b 100644 --- a/src/PVE/RESTHandler.pm +++ b/src/PVE/RESTHandler.pm @@ -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; -- 2.39.2