@@ -243,11 +243,14 @@ def query(key, keyid, method='GET', params=None, headers=None,
243
243
log .debug ('Deleted bucket %s' , bucket )
244
244
return None
245
245
246
+ sortof_ok = ['SlowDown' , 'ServiceUnavailable' , 'RequestTimeTooSkewed' ,
247
+ 'RequestTimeout' , 'OperationAborted' , 'InternalError' ,
248
+ 'AccessDenied' ]
249
+
246
250
# This can be used to save a binary object to disk
247
251
if local_file and method == 'GET' :
248
252
if result .status_code < 200 or result .status_code >= 300 :
249
- if err_code in ['SlowDown' , 'ServiceUnavailable' , 'RequestTimeTooSkewed' ,
250
- 'RequestTimeout' , 'OperationAborted' , 'InternalError' ]:
253
+ if err_code in sortof_ok :
251
254
log .error ('Failed to get file. %s: %s' , err_code , err_msg )
252
255
return None
253
256
raise CommandExecutionError (
@@ -260,8 +263,7 @@ def query(key, keyid, method='GET', params=None, headers=None,
260
263
return 'Saved to local file: {0}' .format (local_file )
261
264
262
265
if result .status_code < 200 or result .status_code >= 300 :
263
- if err_code in ['SlowDown' , 'ServiceUnavailable' , 'RequestTimeTooSkewed' ,
264
- 'RequestTimeout' , 'OperationAborted' , 'InternalError' ]:
266
+ if err_code in sortof_ok :
265
267
log .error ('Failed s3 operation. %s: %s' , err_code , err_msg )
266
268
return None
267
269
raise CommandExecutionError (
0 commit comments