Changeset 819
- Timestamp:
- 03/10/10 00:40:38 (14 years ago)
- Location:
- LATMOS-Accounts
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
LATMOS-Accounts/Makefile.PL
r816 r819 5 5 WriteMakefile( 6 6 NAME => 'LATMOS::Accounts', 7 VERSION => '0.0. 19', # finds $VERSION7 VERSION => '0.0.20', # finds $VERSION 8 8 PREREQ_PM => { 9 9 'Net::LDAP' => undef, -
LATMOS-Accounts/lib/LATMOS/Accounts/Synchro.pm
r815 r819 141 141 $_->wexported($state{$_->label}); 142 142 } 143 $self->run_post_synchro;144 143 } 145 144 … … 214 213 my %desterror; 215 214 my %existings; 215 my $updated = 0; 216 216 foreach my $destbase ($self->to) { 217 217 my %objlist; … … 225 225 foreach ($destbase->list_objects($otype)) { 226 226 if(!$existings{$otype}{$_}) { 227 my $res = $destbase->sync_object_from($self->from, $otype, $_, %options); 228 la_log(LA_NOTICE, "%s::%s::%s => %s %s", 229 $self->from->label, $otype, $_, $destbase->label, $res, 230 ) if ($res); 227 if (my $res = $destbase->sync_object_from($self->from, 228 $otype, $_, %options)) { 229 la_log(LA_NOTICE, "%s::%s::%s => %s %s", 230 $self->from->label, $otype, $_, $destbase->label, $res, 231 ); 232 $updated = 1; 233 } 231 234 } 232 235 } … … 246 249 %options, firstpass => $pass); 247 250 if (defined $res) { 248 la_log(LA_NOTICE, "%s::%s::%s => %s %s", 249 $self->from->label, $otype, $_, 250 $destbase->label, $res, 251 ) if ($res); 251 if ($res) { 252 la_log(LA_NOTICE, "%s::%s::%s => %s %s", 253 $self->from->label, $otype, $_, 254 $destbase->label, $res, 255 ); 256 $updated = 1; 257 } 252 258 } else { 253 259 la_log(LA_ERR, "Cannot synch %s::%s::%s => %s", … … 264 270 265 271 $self->leave_synch_mode(%state); 266 foreach my $destbase ($self->to) { 267 # don't register checkpoint on error 268 if ($desterror{$destbase->label}) { next; } 269 $self->newval($self->from->label, $destbase->label, $self->{current_rev}); 270 } 271 272 if(!($self->{options}{nocreate} || 273 $self->{options}{test})) { 274 $self->write_status; 272 my $res = $self->run_post_synchro( 273 { 274 UPDATED => $updated, 275 } 276 ); 277 if ($res) { 278 foreach my $destbase ($self->to) { 279 # don't register checkpoint on error 280 if ($desterror{$destbase->label}) { next; } 281 $self->newval($self->from->label, $destbase->label, $self->{current_rev}); 282 } 283 284 if(!($self->{options}{nocreate} || 285 $self->{options}{test})) { 286 $self->write_status; 287 } 288 } else { 289 la_log(LA_ERROR, "Not updating status because post script failed"); 275 290 } 276 291 … … 299 314 300 315 sub run_post_synchro { 301 my ($self ) = @_;316 my ($self, $env) = @_; 302 317 303 318 $self->{options}{post} or return 1; … … 305 320 la_log(LA_INFO, "Running post synchro `%s'", $self->{options}{post}); 306 321 307 exec_command($self->{options}{post}, $ self->{options});322 exec_command($self->{options}{post}, $env); 308 323 } 309 324
Note: See TracChangeset
for help on using the changeset viewer.