← Back to team overview

duplicity-team team mailing list archive

[Merge] lp:~matthew-t-bentley/duplicity/b2 into lp:duplicity

 

Matthew Bentley has proposed merging lp:~matthew-t-bentley/duplicity/b2 into lp:duplicity.

Requested reviews:
  duplicity-team (duplicity-team)

For more details, see:
https://code.launchpad.net/~matthew-t-bentley/duplicity/b2/+merge/279908

Fix import and error typos. 
-- 
Your team duplicity-team is requested to review the proposed merge of lp:~matthew-t-bentley/duplicity/b2 into lp:duplicity.
=== modified file 'duplicity/backends/b2backend.py'
--- duplicity/backends/b2backend.py	2015-12-04 11:34:25 +0000
+++ duplicity/backends/b2backend.py	2015-12-08 16:03:28 +0000
@@ -27,6 +27,7 @@
 
 import duplicity.backend
 from duplicity.errors import BackendException, FatalBackendException
+from duplicity import log
 
 import json
 import urllib2
@@ -122,8 +123,8 @@
         endpoint = 'b2_list_file_names'
         url = self.formatted_url(endpoint)
         params = {
-            'bucketId': self.bucket_id,
-            'maxFileCount': 1000,
+                'bucketId': self.bucket_id,
+                'maxFileCount': 1000,
         }
         try:
             resp = self.get_or_post(url, params)
@@ -176,12 +177,10 @@
 
     def _error_code(self, operation, e):
         if isinstance(e, urllib2.HTTPError):
-            if e.code == 400:
-                return log.ErrorCode.bad_request
             if e.code == 500:
-                return log.ErrorCode.backed_error
+                return log.ErrorCode.backend_error
             if e.code == 403:
-                return log.ErrorCode.backed_permission_denied
+                return log.ErrorCode.backend_permission_denied
 
     def find_or_create_bucket(self, bucket_name):
         """
@@ -215,7 +214,7 @@
             'accountId': self.account_id,
             'bucketName': bucket_name,
             'bucketType': 'allPrivate'
-        }
+            }
         resp = self.get_or_post(url, params)
 
         self.bucket_id = resp['bucketId']


Follow ups