5
0
mirror of git://git.proxmox.com/git/pve-zsync.git synced 2025-01-18 14:03:35 +03:00

fix another case where source-user was used to connect to dest

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2018-11-17 15:35:24 +01:00
parent d034d43881
commit c9e2de9409

View File

@ -887,10 +887,10 @@ sub snapshot_destroy {
}
sub snapshot_exist {
my ($source , $dest, $method, $source_user) = @_;
my ($source , $dest, $method, $dest_user) = @_;
my $cmd = [];
push @$cmd, 'ssh', "$source_user\@$dest->{ip}", '--' if $dest->{ip};
push @$cmd, 'ssh', "$dest_user\@$dest->{ip}", '--' if $dest->{ip};
push @$cmd, 'zfs', 'list', '-rt', 'snapshot', '-Ho', 'name';
my $path = $dest->{all};
@ -922,7 +922,7 @@ sub send_image {
push @$cmd, 'zfs', 'send';
push @$cmd, '-v' if $param->{verbose};
if($source->{last_snap} && snapshot_exist($source , $dest, $param->{method}, $param->{source_user})) {
if($source->{last_snap} && snapshot_exist($source , $dest, $param->{method}, $param->{dest_user})) {
push @$cmd, '-i', "$source->{all}\@$source->{last_snap}";
}
push @$cmd, '--', "$source->{all}\@$source->{new_snap}";