As reported in the community forum and reproduced locally, issuing a
QEMU guest agent command would lead to an error when proxying to
another node:
> root@pve8a2 ~ # pvesh create /nodes/pve8a1/qemu/126/agent/exec --command 'whoami'
> Wide character in die at /usr/share/perl5/PVE/RESTHandler.pm line 918.
> proxy handler failed: Agent error: Guest agent command failed, error was 'Failed to execute child process “ARRAY(0x55842bb161a0)” (No such file or directory)'
Fix it, by splitting up array references correctly.
[0]: https://forum.proxmox.com/threads/136520/
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
my $args = [];
foreach my $key (keys %$param) {
next if $key eq 'quiet' || $key eq 'output-format'; # just to be sure
- push @$args, "--$key", $_ for split(/\0/, $param->{$key});
+ if (ref($param->{$key}) eq 'ARRAY') {
+ push @$args, "--$key", $_ for $param->{$key}->@*;
+ } else {
+ push @$args, "--$key", $_ for split(/\0/, $param->{$key});
+ }
}
my @ssh_tunnel_cmd = ('ssh', '-o', 'BatchMode=yes', "root\@$remip");