View | Details | Raw Unified | Return to bug 35173
Collapse All | Expand All

(-)a/Koha/Edifact/Transport.pm (-6 / +5 lines)
Lines 148-157 sub sftp_download { Link Here
148
    }
148
    }
149
    $sftp->setcwd( $self->{account}->download_directory )
149
    $sftp->setcwd( $self->{account}->download_directory )
150
      or return $self->_abort_download( $sftp,
150
      or return $self->_abort_download( $sftp,
151
        "Cannot change remote dir : $sftp->error" );
151
        "Cannot change remote dir: " . $sftp->error );
152
    my $file_list = $sftp->ls()
152
    my $file_list = $sftp->ls()
153
      or return $self->_abort_download( $sftp,
153
      or return $self->_abort_download( $sftp,
154
        "cannot get file list from server: $sftp->error" );
154
        "cannot get file list from server: " . $sftp->error );
155
    foreach my $file ( @{$file_list} ) {
155
    foreach my $file ( @{$file_list} ) {
156
        my $filename = $file->{filename};
156
        my $filename = $file->{filename};
157
157
Lines 159-165 sub sftp_download { Link Here
159
            $sftp->get( $filename, "$self->{working_dir}/$filename" );
159
            $sftp->get( $filename, "$self->{working_dir}/$filename" );
160
            if ( $sftp->error ) {
160
            if ( $sftp->error ) {
161
                $self->_abort_download( $sftp,
161
                $self->_abort_download( $sftp,
162
                    "Error retrieving $filename: $sftp->error" );
162
                    "Error retrieving $filename: " . $sftp->error );
163
                last;
163
                last;
164
            }
164
            }
165
            push @downloaded_files, $filename;
165
            push @downloaded_files, $filename;
Lines 170-176 sub sftp_download { Link Here
170
            my $ret = $sftp->rename( $filename, $processed_name );
170
            my $ret = $sftp->rename( $filename, $processed_name );
171
            if ( !$ret ) {
171
            if ( !$ret ) {
172
                $self->_abort_download( $sftp,
172
                $self->_abort_download( $sftp,
173
                    "Error renaming $filename: $sftp->error" );
173
                    "Error renaming $filename: " . $sftp->error );
174
                last;
174
                last;
175
            }
175
            }
176
176
Lines 302-308 sub sftp_upload { Link Here
302
    $sftp->die_on_error("Cannot ssh to $self->{account}->host");
302
    $sftp->die_on_error("Cannot ssh to $self->{account}->host");
303
    $sftp->setcwd( $self->{account}->upload_directory )
303
    $sftp->setcwd( $self->{account}->upload_directory )
304
      or return $self->_abort_download( $sftp,
304
      or return $self->_abort_download( $sftp,
305
        "Cannot change remote dir : $sftp->error" );
305
        "Cannot change remote dir : " . $sftp->error );
306
    foreach my $m (@messages) {
306
    foreach my $m (@messages) {
307
        my $content = $m->raw_msg;
307
        my $content = $m->raw_msg;
308
        if ($content) {
308
        if ($content) {
309
- 

Return to bug 35173