[pve-devel] applied: [PATCH pve-client 1/4] JSONSchema: fix getopt when invoking without arguments

Dietmar Maurer dietmar at proxmox.com
Wed Jun 6 08:15:50 CEST 2018


Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
---
 PVE/JSONSchema.pm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/PVE/JSONSchema.pm b/PVE/JSONSchema.pm
index 0e722b8..edd1caf 100644
--- a/PVE/JSONSchema.pm
+++ b/PVE/JSONSchema.pm
@@ -1406,6 +1406,8 @@ sub get_options {
 	    raise("too many arguments\n", code => HTTP_BAD_REQUEST)
 		if scalar(@$args) != 0;
 	}
+    } else {
+	raise("not enough arguments\n", code => HTTP_BAD_REQUEST) if ref($arg_param) && scalar(@$arg_param);
     }
 
     if (my $pd = $schema->{properties}->{password}) {
-- 
2.11.0




More information about the pve-devel mailing list