Revision 810d80b8 kamaki/clients/storage.py
b/kamaki/clients/storage.py | ||
---|---|---|
74 | 74 |
|
75 | 75 |
return reply |
76 | 76 |
|
77 |
def create_object(self, object, f, hash_cb=None, upload_cb=None): |
|
77 |
def create_object(self, object, f, size=None, hash_cb=None, |
|
78 |
upload_cb=None): |
|
78 | 79 |
# This is a naive implementation, it loads the whole file in memory |
79 | 80 |
self.assert_container() |
80 | 81 |
path = '/%s/%s/%s' % (self.account, self.container, object) |
81 |
data = f.read() |
|
82 |
data = f.read(size) if size is not None else f.read()
|
|
82 | 83 |
self.put(path, data=data, success=201) |
83 | 84 |
|
84 | 85 |
def get_object(self, object): |
Also available in: Unified diff