]> git.proxmox.com Git - pve-zsync.git/commitdiff
fix use path as source
authorWolfgang Link <w.link@proxmox.com>
Wed, 15 Jun 2016 06:10:33 +0000 (08:10 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 16 Jun 2016 09:45:05 +0000 (11:45 +0200)
pve-zsync

index 440ab56a13b95dba954a4de588e2257952ca1683..779c5d4abc1550cbe4b04b2efaf97106cf192e62 100644 (file)
--- a/pve-zsync
+++ b/pve-zsync
@@ -477,11 +477,11 @@ sub init {
        run_cmd(['ssh-copy-id', '-i', '/root/.ssh/id_rsa.pub', "root\@$ip"]);
     }
 
-    die "Pool $dest->{all} does not exists\n" if check_pool_exists($dest);
+    die "Pool $dest->{all} does not exists\n" if !check_pool_exists($dest);
 
-    my $check = check_pool_exists($source->{path}, $source->{ip}) if !$source->{vmid} && $source->{path};
-
-    die "Pool $source->{path} does not exists\n" if undef($check);
+    if (!defined($source->{vmid})) {
+       die "Pool $source->{all} does not exists\n" if !check_pool_exists($source);
+    }
 
     my $vm_type = vm_exists($source);
     $job->{vm_type} = $vm_type;