[pve-devel] [PATCH v2 guest-common 2/5] use PVE::SSHInfo

Fabian Grünbichler f.gruenbichler at proxmox.com
Mon Nov 11 11:28:20 CET 2019


Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---

Notes:
    requires versioned dependency on libpve-cluster-perl

 PVE/AbstractMigrate.pm | 5 +++--
 PVE/Replication.pm     | 9 +++++----
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/PVE/AbstractMigrate.pm b/PVE/AbstractMigrate.pm
index 908d972..af2be38 100644
--- a/PVE/AbstractMigrate.pm
+++ b/PVE/AbstractMigrate.pm
@@ -8,6 +8,7 @@ use PVE::Tools;
 use PVE::Cluster;
 use PVE::DataCenterConfig;
 use PVE::ReplicationState;
+use PVE::SSHInfo;
 
 my $msg2text = sub {
     my ($level, $msg) = @_;
@@ -120,7 +121,7 @@ sub migrate {
     if (!defined($migration_network)) {
 	$migration_network = $dc_conf->{migration}->{network};
     }
-    my $ssh_info = PVE::Cluster::get_ssh_info($node, $migration_network);
+    my $ssh_info = PVE::SSHInfo::get_ssh_info($node, $migration_network);
     $nodeip = $ssh_info->{ip};
 
     my $migration_type = 'secure';
@@ -138,7 +139,7 @@ sub migrate {
 	node => $node,
 	ssh_info => $ssh_info,
 	nodeip => $nodeip,
-	rem_ssh => PVE::Cluster::ssh_info_to_command($ssh_info)
+	rem_ssh => PVE::SSHInfo::ssh_info_to_command($ssh_info)
     };
 
     $self = bless $self, $class;
diff --git a/PVE/Replication.pm b/PVE/Replication.pm
index c3e7564..7440bed 100644
--- a/PVE/Replication.pm
+++ b/PVE/Replication.pm
@@ -16,6 +16,7 @@ use PVE::Storage;
 use PVE::GuestHelpers;
 use PVE::ReplicationConfig;
 use PVE::ReplicationState;
+use PVE::SSHInfo;
 
 
 # regression tests should overwrite this
@@ -80,7 +81,7 @@ sub find_common_replication_snapshot {
 sub remote_prepare_local_job {
     my ($ssh_info, $jobid, $vmid, $volumes, $storeid_list, $last_sync, $parent_snapname, $force, $logfunc) = @_;
 
-    my $ssh_cmd = PVE::Cluster::ssh_info_to_command($ssh_info);
+    my $ssh_cmd = PVE::SSHInfo::ssh_info_to_command($ssh_info);
     my $cmd = [@$ssh_cmd, '--', 'pvesr', 'prepare-local-job', $jobid];
     push @$cmd, '--scan', join(',', @$storeid_list) if scalar(@$storeid_list);
     push @$cmd, @$volumes if scalar(@$volumes);
@@ -114,7 +115,7 @@ sub remote_prepare_local_job {
 sub remote_finalize_local_job {
     my ($ssh_info, $jobid, $vmid, $volumes, $last_sync, $logfunc) = @_;
 
-    my $ssh_cmd = PVE::Cluster::ssh_info_to_command($ssh_info);
+    my $ssh_cmd = PVE::SSHInfo::ssh_info_to_command($ssh_info);
     my $cmd = [@$ssh_cmd, '--', 'pvesr', 'finalize-local-job', $jobid,
 	       @$volumes, '--last_sync', $last_sync];
 
@@ -238,7 +239,7 @@ sub replicate {
 
 	    my %hash = map { $_ => 1 } @store_list;
 
-	    my $ssh_info = PVE::Cluster::get_ssh_info($jobcfg->{target});
+	    my $ssh_info = PVE::SSHInfo::get_ssh_info($jobcfg->{target});
 	    remote_prepare_local_job($ssh_info, $jobid, $vmid, [], [ keys %hash ], 1, undef, 1, $logfunc);
 
 	}
@@ -251,7 +252,7 @@ sub replicate {
 	return undef;
     }
 
-    my $ssh_info = PVE::Cluster::get_ssh_info($jobcfg->{target}, $migration_network);
+    my $ssh_info = PVE::SSHInfo::get_ssh_info($jobcfg->{target}, $migration_network);
 
     my $parent_snapname = $conf->{parent};
 
-- 
2.20.1





More information about the pve-devel mailing list