mirror of
git://git.proxmox.com/git/pve-guest-common.git
synced 2025-01-11 05:17:49 +03:00
use PVE::SSHInfo
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
parent
96c08a9dcd
commit
0c85474f68
@ -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;
|
||||
|
@ -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};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user