diff --git a/storage/cloud.py b/storage/cloud.py index 9ea804c35..3c28480dc 100644 --- a/storage/cloud.py +++ b/storage/cloud.py @@ -444,6 +444,8 @@ class GoogleCloudStorage(_CloudStorage): # TODO figure out how to handle cancel_on_error=False key.set_contents_from_stream(fp) + return key.size + class RadosGWStorage(_CloudStorage): def __init__(self, hostname, is_secure, storage_path, access_key, secret_key, bucket_name): diff --git a/util/registry/filelike.py b/util/registry/filelike.py index 7acb45c4d..6ea5b25dd 100644 --- a/util/registry/filelike.py +++ b/util/registry/filelike.py @@ -10,6 +10,9 @@ class BaseStreamFilelike(object): self._fileobj = fileobj self._cursor_position = 0 + def close(self): + self._fileobj.close() + def read(self, size=READ_UNTIL_END): buf = self._fileobj.read(size) self._cursor_position += len(buf)