Fix bugs with pushing, pulling, and deleting.

This commit is contained in:
Jake Moshenko 2014-06-17 16:37:48 -04:00
parent bf98575feb
commit bf0e01fba5
3 changed files with 16 additions and 15 deletions

View file

@ -4,6 +4,18 @@ import tempfile
class StoragePaths(object):
shared_images = 'sharedimages'
@staticmethod
def temp_store_handler():
tmpf = tempfile.TemporaryFile()
def fn(buf):
try:
tmpf.write(buf)
except IOError:
pass
return tmpf, fn
def image_path(self, storage_uuid):
return '{0}/{1}/'.format(self.shared_images, storage_uuid)
@ -42,18 +54,6 @@ class BaseStorage(StoragePaths):
# Set the IO buffer to 64kB
buffer_size = 64 * 1024
@staticmethod
def temp_store_handler():
tmpf = tempfile.TemporaryFile()
def fn(buf):
try:
tmpf.write(buf)
except IOError:
pass
return tmpf, fn
def get_direct_download_url(self, path, expires_in=60):
return None