From 601ed3ed0ffb81d743201c3819d18f79cee850f5 Mon Sep 17 00:00:00 2001 From: drebs Date: Fri, 8 Dec 2017 22:41:59 -0200 Subject: [refactor] make get_tag() return a deferred --- src/leap/soledad/server/_blobs.py | 2 +- src/leap/soledad/server/interfaces.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/leap/soledad/server') diff --git a/src/leap/soledad/server/_blobs.py b/src/leap/soledad/server/_blobs.py index 7210cb6a..9d1c9b1e 100644 --- a/src/leap/soledad/server/_blobs.py +++ b/src/leap/soledad/server/_blobs.py @@ -206,7 +206,7 @@ class FilesystemBlobsBackend(object): with open(blob_path) as doc_file: doc_file.seek(-16, 2) tag = base64.urlsafe_b64encode(doc_file.read()) - return tag + return defer.succeed(tag) @defer.inlineCallbacks def _get_disk_usage(self, start_path): diff --git a/src/leap/soledad/server/interfaces.py b/src/leap/soledad/server/interfaces.py index c00b1d91..ecea0bf8 100644 --- a/src/leap/soledad/server/interfaces.py +++ b/src/leap/soledad/server/interfaces.py @@ -158,8 +158,8 @@ class IBlobsBackend(Interface): :param namespace: An optional namespace for the blob. :type namespace: str - :return: The tag of the blob. - :rtype: str + :return: A deferred that fires with the tag of the blob. + :rtype: twisted.internet.defer.Deferred """ def get_flags(user, blob_id, namespace=''): -- cgit v1.2.3