diff --git a/pog/fs/b2fs.py b/pog/fs/b2fs.py index a8eeedf..4ea4066 100644 --- a/pog/fs/b2fs.py +++ b/pog/fs/b2fs.py @@ -4,12 +4,14 @@ from subprocess import check_output from b2sdk.v2 import B2Api -from b2sdk.exception import FileNotPresent +from b2sdk.v2.exception import FileNotPresent from .pogfs import Pogfs BUCKET_NAME = environ.get('B2_BUCKET_NAME') +APP_ID = environ.get('B2_APPLICATION_KEY_ID') +APP_SECRET = environ.get('B2_APPLICATION_KEY') class b2fs(Pogfs): @@ -18,6 +20,7 @@ def __init__(self, bucket_name=None, **kwargs): def _get_bucket(self): api = B2Api() + api.authorize_account('production', APP_ID, APP_SECRET) return api.get_bucket_by_name(self.bucket_name) def exists(self, remote_path):