Changeset 563
- Timestamp:
- 12/17/09 14:43:52 (15 years ago)
- Location:
- LATMOS-Accounts/lib/LATMOS
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
LATMOS-Accounts/lib/LATMOS/Accounts.pm
r562 r563 180 180 my $sync = LATMOS::Accounts::Synchro->new( 181 181 $labfrom, [ @labto ], 182 state_file => ($self->val('_default_', 'state_dir') 183 ? $self->val('_default_', 'state_dir') . '/synchronisation.ini' 184 : undef), 182 state_dir => ($self->val('_default_', 'state_dir') || undef), 185 183 %options, 186 184 name => $name, -
LATMOS-Accounts/lib/LATMOS/Accounts/Synchro.pm
r541 r563 42 42 my ($class, $from, $to, %options) = @_; 43 43 44 if ($options{state_file} && ! -w $options{state_file}) { 44 my $state_file = $options{state_dir} 45 ? $options{state_dir} . '/synchronisation.ini' 46 : undef; 47 if ($state_file && ! -w $state_file) { 45 48 # don't exists, we have to create it 46 open(my $handle, '>', $ options{state_file}) or do {47 la_log(LA_ERR, "Cannot open status file %s", $ options{state_file});49 open(my $handle, '>', $state_file) or do { 50 la_log(LA_ERR, "Cannot open status file %s", $state_file); 48 51 return; 49 52 }; … … 54 57 my $self = Config::IniFiles->new( 55 58 $options{state_file} 56 ? (-file => $ options{state_file})59 ? (-file => $state_file) 57 60 : (), 58 61 ); 59 62 60 if ($ options{state_file}&& !$self->GetFileName) {61 $self->SetFileName($ options{state_file});63 if ($state_file && !$self->GetFileName) { 64 $self->SetFileName($state_file); 62 65 } 63 66 … … 138 141 $self->run_post_synchro; 139 142 } 140 141 143 142 144 sub sync_object {
Note: See TracChangeset
for help on using the changeset viewer.