From 65bb98596c63c66d4a0123922ef809ab9cf9e40c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fabian=20Gr=C3=BCnbichler?= Date: Mon, 11 Nov 2019 11:28:15 +0100 Subject: [PATCH] use PVE::SSHInfo MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Fabian Grünbichler --- PVE/API2/Storage/Content.pm | 3 ++- PVE/Storage.pm | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/PVE/API2/Storage/Content.pm b/PVE/API2/Storage/Content.pm index 9f6ea10..ce89ec5 100644 --- a/PVE/API2/Storage/Content.pm +++ b/PVE/API2/Storage/Content.pm @@ -12,6 +12,7 @@ use PVE::Exception qw(raise_param_exc); use PVE::RPCEnvironment; use PVE::RESTHandler; use PVE::JSONSchema qw(get_standard_option); +use PVE::SSHInfo; use base qw(PVE::RESTHandler); @@ -410,7 +411,7 @@ __PACKAGE__->register_method ({ # you need to get this working (fails currently, because storage_migrate() uses # ssh to connect to local host (which is not needed - my $sshinfo = PVE::Cluster::get_ssh_info($target_node); + my $sshinfo = PVE::SSHInfo::get_ssh_info($target_node); PVE::Storage::storage_migrate($cfg, $src_volid, $sshinfo, $target_sid, $target_volname); print "DEBUG: end worker $upid\n"; diff --git a/PVE/Storage.pm b/PVE/Storage.pm index b9437c8..bb3b874 100755 --- a/PVE/Storage.pm +++ b/PVE/Storage.pm @@ -20,6 +20,7 @@ use PVE::Exception qw(raise_param_exc); use PVE::JSONSchema; use PVE::INotify; use PVE::RPCEnvironment; +use PVE::SSHInfo; use PVE::Storage::Plugin; use PVE::Storage::DirPlugin; @@ -574,8 +575,8 @@ sub storage_migrate { my $target_ip = $target_sshinfo->{ip}; my $errstr = "unable to migrate '$volid' to '${target_volid}' on host '$target_sshinfo->{name}'"; - my $ssh = PVE::Cluster::ssh_info_to_command($target_sshinfo); - my $ssh_base = PVE::Cluster::ssh_info_to_command_base($target_sshinfo); + my $ssh = PVE::SSHInfo::ssh_info_to_command($target_sshinfo); + my $ssh_base = PVE::SSHInfo::ssh_info_to_command_base($target_sshinfo); local $ENV{RSYNC_RSH} = PVE::Tools::cmd2string($ssh_base); my @cstream = ([ '/usr/bin/cstream', '-t', $ratelimit_bps ]) -- 2.39.2