[aws] Avoid bulk delete if there is only one key
@@ -361,6 +361,11 @@ class S3FileSystem(object):
)
LOG.error(msg)
raise S3FileSystemException(msg)
+ else:
+ # Avoid Raz issues
+ deleted_key = key.bucket.delete_key(next(to_delete))
+ if deleted_key.exists():
+ raise S3FileSystemException('Could not delete key %s' % deleted_key)
@translate_s3_error
@auth_error_handler
