Merge pull request #554 from jzelinskie/v2-gcs
make registry v2 tests pass for GCS
This commit is contained in:
commit
c31c8cbf3c
2 changed files with 5 additions and 0 deletions
|
@ -444,6 +444,8 @@ class GoogleCloudStorage(_CloudStorage):
|
||||||
# TODO figure out how to handle cancel_on_error=False
|
# TODO figure out how to handle cancel_on_error=False
|
||||||
key.set_contents_from_stream(fp)
|
key.set_contents_from_stream(fp)
|
||||||
|
|
||||||
|
return key.size
|
||||||
|
|
||||||
|
|
||||||
class RadosGWStorage(_CloudStorage):
|
class RadosGWStorage(_CloudStorage):
|
||||||
def __init__(self, hostname, is_secure, storage_path, access_key, secret_key, bucket_name):
|
def __init__(self, hostname, is_secure, storage_path, access_key, secret_key, bucket_name):
|
||||||
|
|
|
@ -10,6 +10,9 @@ class BaseStreamFilelike(object):
|
||||||
self._fileobj = fileobj
|
self._fileobj = fileobj
|
||||||
self._cursor_position = 0
|
self._cursor_position = 0
|
||||||
|
|
||||||
|
def close(self):
|
||||||
|
self._fileobj.close()
|
||||||
|
|
||||||
def read(self, size=READ_UNTIL_END):
|
def read(self, size=READ_UNTIL_END):
|
||||||
buf = self._fileobj.read(size)
|
buf = self._fileobj.read(size)
|
||||||
self._cursor_position += len(buf)
|
self._cursor_position += len(buf)
|
||||||
|
|
Reference in a new issue