[pve-devel] applied: [PATCH pve-common v2] fix getopt when invoking without arguments
Dietmar Maurer
dietmar at proxmox.com
Fri Jun 8 06:29:27 CEST 2018
applied
> On June 7, 2018 at 7:52 AM Dietmar Maurer <dietmar at proxmox.com> wrote:
>
>
> Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
> ---
> src/PVE/JSONSchema.pm | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/src/PVE/JSONSchema.pm b/src/PVE/JSONSchema.pm
> index 0e722b8..f014dc3 100644
> --- a/src/PVE/JSONSchema.pm
> +++ b/src/PVE/JSONSchema.pm
> @@ -1406,6 +1406,16 @@ sub get_options {
> raise("too many arguments\n", code => HTTP_BAD_REQUEST)
> if scalar(@$args) != 0;
> }
> + } else {
> + if (ref($arg_param)) {
> + foreach my $arg_name (@$arg_param) {
> + if ($arg_name eq 'extra-args') {
> + $opts->{'extra-args'} = [];
> + } else {
> + raise("not enough arguments\n", code => HTTP_BAD_REQUEST);
> + }
> + }
> + }
> }
>
> if (my $pd = $schema->{properties}->{password}) {
> --
> 2.11.0
>
>
More information about the pve-devel
mailing list