Ignore:
Timestamp:
08/13/15 17:53:30 (9 years ago)
Author:
nanardon
Message:

Add a noDelete options to synchronization

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Synchro.pm

    r1354 r1377  
    275275    my %desterror; 
    276276    my $updated = 0; 
     277 
     278    # We do base one by one 
     279 
    277280    foreach my $destbase ($self->to) { 
    278281        my %objlist; 
     
    298301 
    299302            # deleting non existing object in dest: 
     303 
     304            # Sync: noDelete.Base = yes          mean no delete 
     305            #       noDelete.Base.Otype = yes    mean no delete for this object 
     306            if ($self->{options}->{'noDelete'} || 
     307                $self->{options}->{'noDelete.' . $destbase->label} || 
     308                $self->{options}->{'noDelete.' . $destbase->label . '.' . $otype}) { 
     309                la_log(LA_INFO, 'Not deleting object type\'%s` from base \'%s` because %s is set', 
     310                    $otype, 
     311                    $destbase->label, 
     312                    $self->{options}->{'noDelete.' . $destbase->label . '.' . $otype} 
     313                        ? 'noDelete.' . $destbase->label . '.' . $otype 
     314                        : $self->{options}->{'noDelete.' . $destbase->label} 
     315                            ? 'noDelete.' . $destbase->label 
     316                            : 'noDelete' 
     317                ); 
     318            } else { 
     319 
    300320            my $deletefiltered = 'deletefiltered.' . $destbase->label . '.' . $otype; 
     321 
    301322            foreach ($destbase->list_objects($otype)) { 
    302323 
     
    326347                } 
    327348            } 
     349            } # noDelete.Base 
     350 
    328351 
    329352            # Finding object to synchronize: 
Note: See TracChangeset for help on using the changeset viewer.