Changeset 1377 for trunk


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

Add a noDelete options to synchronization

Location:
trunk/LATMOS-Accounts
Files:
2 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: 
  • trunk/LATMOS-Accounts/man/man5/latmos-accounts.ini.pod

    r1354 r1377  
    135135feature (SQL only at time) 
    136136 
     137=head3 noDelete 
     138 
     139Setting this parameter will make the syncronisation not deleting object in 
     140destination bases. 
     141 
     142Setting the C<noDelete.BASE> where C<BASE> is the name of an synchronized base 
     143will make this synchronisation not deleting any object into this base, 
     144 
     145Setting the C<noDelete.BASE.OTYPE> will make the synchronisation not deleting 
     146object type C<OTYPE> no delete into the base named C<BASE>. 
     147 
     148Example: 
     149 
     150    noDelete.MyLdap.user = yes 
     151 
    137152=head3 filtering object propagation 
    138153 
     
    146161 
    147162  filter.ldap.user = memberOf=unix 
     163 
    148164 
    149165=head3 Deleting filtered object 
Note: See TracChangeset for help on using the changeset viewer.