[pve-devel] applied: [PATCH manager] Add all standard output options that are not yet defined

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Mar 2 20:21:58 CET 2020


On 3/2/20 10:21 AM, Fabian Ebner wrote:
> When a property description already contained an option, no
> standard output options at all would be added to it, e.g.
> '/nodes/NODE/vzdump' already defines its own 'quiet'.
> Now all not yet defined options are added to the description.
> 
> Fixes
> pvesh create /nodes/NODE/vzdump -vmid ID -storage STORAGE
> issued from a different node and
> pvesh create /nodes/NODE/vzdump -vmid ID -storage STORAGE --output-format json
> and maybe other calls.
> 
> Reported here: https://forum.proxmox.com/threads/output-format-error-with-pvesh-create.47711/
> 
> Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
> ---
>  PVE/CLI/pvesh.pm | 9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)
> 

applied, much thanks. But, this gives me a big déjà vu, as I had seen such a
patch/fix already, strange.. Anyway, thanks a lot. Would you care to check
pmgsh from the Mailgateway too (I didn't looked at all if it even can be affected
by a similar issue, FYI)
 

> diff --git a/PVE/CLI/pvesh.pm b/PVE/CLI/pvesh.pm
> index dd389969..370fdb0e 100755
> --- a/PVE/CLI/pvesh.pm
> +++ b/PVE/CLI/pvesh.pm
> @@ -276,14 +276,9 @@ my $extract_std_options = 1;
>  my $cond_add_standard_output_properties = sub {
>      my ($props) = @_;
>  
> -    foreach my $opt (keys %$PVE::RESTHandler::standard_output_options) {
> -	if (defined($props->{$opt})) {
> -	    $extract_std_options = 0;
> -	    return $props;
> -	}
> -    }
> +    my $keys = [ grep { !defined($props->{$_}) } keys %$PVE::RESTHandler::standard_output_options ];
>  
> -    return PVE::RESTHandler::add_standard_output_properties($props);
> +    return PVE::RESTHandler::add_standard_output_properties($props, $keys);
>  };
>  
>  sub call_api_method {
> 






More information about the pve-devel mailing list