]> git.proxmox.com Git - pmg-api.git/commitdiff
fix bug #2035 cluster sync issues with ipv6
authorOguz Bektas <o.bektas@proxmox.com>
Mon, 17 Dec 2018 12:56:59 +0000 (13:56 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 18 Dec 2018 09:22:13 +0000 (10:22 +0100)
rsync needs ipv6 addresses to be in brackets, otherwise issues arise
when joining/syncing cluster

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
PMG/Cluster.pm

index 9e456f16e4b9f3690b8681f424a7e0ec2de1bc9f..319a45bb388aed65cc403a45c79421dd880eaf3b 100644 (file)
@@ -300,7 +300,7 @@ sub sync_quarantine_files {
     mkdir $syncdir;
 
     my $cmd = $rsync_command->(
-       $host_name, '--timeout', '10', "${host_ip}:$spooldir", $spooldir,
+       $host_name, '--timeout', '10', "[${host_ip}]:$spooldir", $spooldir,
        '--files-from', $flistname);
 
     PVE::Tools::run_command($cmd);
@@ -316,7 +316,7 @@ sub sync_spooldir {
     mkdir $syncdir;
 
     my $cmd = $rsync_command->(
-       $host_name, '-aq', '--timeout', '10', "${host_ip}:$syncdir/", $syncdir);
+       $host_name, '-aq', '--timeout', '10', "[${host_ip}]:$syncdir/", $syncdir);
 
     foreach my $incl (('spam/', 'spam/*', 'spam/*/*', 'virus/', 'virus/*', 'virus/*/*')) {
        push @$cmd, '--include', $incl;
@@ -336,7 +336,7 @@ sub sync_master_quar {
     mkdir $syncdir;
 
     my $cmd = $rsync_command->(
-       $host_name, '-aq', '--timeout', '10', "${host_ip}:$syncdir", $syncdir);
+       $host_name, '-aq', '--timeout', '10', "[${host_ip}]:$syncdir", $syncdir);
 
     PVE::Tools::run_command($cmd);
 }
@@ -352,7 +352,7 @@ sub sync_config_from_master {
 
     my $cmd = $rsync_command->(
        $master_name, '-aq',
-       "${master_ip}:$cfgdir/* ${sa_conf_dir}/${sa_custom_cf}",
+       "[${master_ip}]:$cfgdir/* ${sa_conf_dir}/${sa_custom_cf}",
        "$syncdir/",
        '--exclude', 'master/',
        '--exclude', '*~',