~bmerry/duplicity/pydrive-regular

« back to all changes in this revision

Viewing changes to duplicity/backends/_boto_single.py

  • Committer: Michael Terry
  • Date: 2014-04-17 20:50:57 UTC
  • mto: This revision was merged to the branch mainline in revision 975.
  • Revision ID: michael.terry@canonical.com-20140417205057-4cxo1yebh0oer02a
Solve except 2to3 fix

Show diffs side-by-side

added added

removed removed

Lines of Context:
202
202
            try:
203
203
                try:
204
204
                    self.bucket = self.conn.get_bucket(self.bucket_name, validate=True)
205
 
                except Exception, e:
 
205
                except Exception as e:
206
206
                    if "NoSuchBucket" in str(e):
207
207
                        if globals.s3_european_buckets:
208
208
                            self.bucket = self.conn.create_bucket(self.bucket_name,
211
211
                            self.bucket = self.conn.create_bucket(self.bucket_name)
212
212
                    else:
213
213
                        raise e
214
 
            except Exception, e:
 
214
            except Exception as e:
215
215
                log.Warn("Failed to create bucket (attempt #%d) '%s' failed (reason: %s: %s)"
216
216
                         "" % (n, self.bucket_name,
217
217
                               e.__class__.__name__,
252
252
                self.resetConnection()
253
253
                log.Debug("Uploaded %s/%s to %s Storage at roughly %f bytes/second" % (self.straight_url, remote_filename, storage_class, rough_upload_speed))
254
254
                return
255
 
            except Exception, e:
 
255
            except Exception as e:
256
256
                log.Warn("Upload '%s/%s' failed (attempt #%d, reason: %s: %s)"
257
257
                         "" % (self.straight_url,
258
258
                               remote_filename,
279
279
                key.get_contents_to_filename(local_path.name)
280
280
                local_path.setdata()
281
281
                return
282
 
            except Exception, e:
 
282
            except Exception as e:
283
283
                log.Warn("Download %s/%s failed (attempt #%d, reason: %s: %s)"
284
284
                         "" % (self.straight_url,
285
285
                               remote_filename,
304
304
            log.Info("Listing %s" % self.straight_url)
305
305
            try:
306
306
                return self._list_filenames_in_bucket()
307
 
            except Exception, e:
 
307
            except Exception as e:
308
308
                log.Warn("List %s failed (attempt #%d, reason: %s: %s)"
309
309
                         "" % (self.straight_url,
310
310
                               n,
348
348
            if key is None:
349
349
                return {'size': -1}
350
350
            return {'size': key.size}
351
 
        except Exception, e:
 
351
        except Exception as e:
352
352
            log.Warn("Query %s/%s failed: %s"
353
353
                     "" % (self.straight_url,
354
354
                           filename,
397
397
                            log.Info("File %s was successfully restored from Glacier" % remote_filename)
398
398
                    success = True
399
399
                    break
400
 
                except Exception, e:
 
400
                except Exception as e:
401
401
                    log.Warn("Restoration from Glacier for file %s/%s failed (attempt #%d, reason: %s: %s)"
402
402
                             "" % (self.straight_url,
403
403
                                   remote_filename,