]> git.proxmox.com Git - pve-storage.git/commitdiff
upload: use SSH helper to get ssh/scp options
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Thu, 11 Jan 2024 10:51:23 +0000 (11:51 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 19 Apr 2024 06:39:59 +0000 (08:39 +0200)
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
src/PVE/API2/Storage/Status.pm

index f7e324fbbf225388801c6b08fed931afefa61ae7..dc6cc6921b23f621fef2925fecf7ee4240e4f427 100644 (file)
@@ -467,9 +467,9 @@ __PACKAGE__->register_method ({
        if ($node ne 'localhost' && $node ne PVE::INotify::nodename()) {
            my $remip = PVE::Cluster::remote_node_ip($node);
 
-           my @ssh_options = ('-o', 'BatchMode=yes');
+           my $ssh_options = PVE::SSHInfo::ssh_info_to_ssh_opts({ ip => $remip, name => $node });
 
-           my @remcmd = ('/usr/bin/ssh', @ssh_options, $remip, '--');
+           my @remcmd = ('/usr/bin/ssh', $ssh_options->@*, $remip, '--');
 
            eval { # activate remote storage
                run_command([@remcmd, '/usr/sbin/pvesm', 'status', '--storage', $param->{storage}]);
@@ -481,7 +481,7 @@ __PACKAGE__->register_method ({
                errmsg => "mkdir failed",
            );
  
-           $cmd = ['/usr/bin/scp', @ssh_options, '-p', '--', $tmpfilename, "[$remip]:" . PVE::Tools::shell_quote($dest)];
+           $cmd = ['/usr/bin/scp', $ssh_options->@*, '-p', '--', $tmpfilename, "[$remip]:" . PVE::Tools::shell_quote($dest)];
 
            $err_cleanup = sub { run_command([@remcmd, 'rm', '-f', '--', $dest]) };
        } else {