]> git.proxmox.com Git - pve-container.git/commitdiff
migrate: cleanup replica volume skip condition
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 28 Apr 2017 08:43:37 +0000 (10:43 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 28 Apr 2017 08:43:37 +0000 (10:43 +0200)
src/PVE/LXC/Migrate.pm

index 0d3452825daa6620a148ea86a6e612920f206226..6d6c2d0687aa8213bf578e504f232977d138513d 100644 (file)
@@ -330,14 +330,15 @@ sub phase3 {
     # destroy local copies
     foreach my $volid (@$volids) {
        # do not destroy if new target is local_host
-       if (!($self->{vmconf}->{replica} && defined($synced_volumes->{$volid})
-             && $self->{vmconf}->{replica_target} eq $self->{opts}->{node}) ) {
-           eval { PVE::Storage::vdisk_free($self->{storecfg}, $volid); };
-           if (my $err = $@) {
-               $self->log('err', "removing local copy of '$volid' failed - $err");
-               $self->{errors} = 1;
-               last if $err =~ /^interrupted by signal$/;
-           }
+       next if $self->{vmconf}->{replica} &&
+           defined($synced_volumes->{$volid}) &&
+           $self->{vmconf}->{replica_target} eq $self->{opts}->{node};
+       
+       eval { PVE::Storage::vdisk_free($self->{storecfg}, $volid); };
+       if (my $err = $@) {
+           $self->log('err', "removing local copy of '$volid' failed - $err");
+           $self->{errors} = 1;
+           last if $err =~ /^interrupted by signal$/;
        }
     }
 }