Restore the temp_store_handler.
This commit is contained in:
parent
e6926b62be
commit
2e9f7cd19d
2 changed files with 16 additions and 1 deletions
|
@ -1,3 +1,6 @@
|
|||
import tempfile
|
||||
|
||||
|
||||
class Storage(object):
|
||||
|
||||
"""Storage is organized as follow:
|
||||
|
@ -13,6 +16,18 @@ class Storage(object):
|
|||
# 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
|
||||
|
||||
#FIXME(samalba): Move all path resolver in each module (out of the base)
|
||||
def images_list_path(self, namespace, repository):
|
||||
return '{0}/{1}/{2}/_images_list'.format(self.repositories,
|
||||
|
|
Reference in a new issue