Revision 2005b18e kamaki/clients/pithos.py
b/kamaki/clients/pithos.py | ||
---|---|---|
230 | 230 |
return r.json |
231 | 231 |
|
232 | 232 |
def _caclulate_uploaded_blocks( |
233 |
self, blocksize, blockhash, size, nblocks, hashes, hmap, fileobj, |
|
234 |
hash_cb=None): |
|
233 |
self, blocksize, blockhash, size, nblocks, hashes, hmap, fileobj,
|
|
234 |
hash_cb=None):
|
|
235 | 235 |
offset = 0 |
236 | 236 |
if hash_cb: |
237 | 237 |
hash_gen = hash_cb(nblocks) |
... | ... | |
269 | 269 |
if thread.exception: |
270 | 270 |
failures.append(thread) |
271 | 271 |
if isinstance( |
272 |
thread.exception, |
|
273 |
ClientError) and thread.exception.status == 502: |
|
274 |
self.POOLSIZE = self._thread_limit
|
|
272 |
thread.exception,
|
|
273 |
ClientError) and thread.exception.status == 502:
|
|
274 |
self.POOLSIZE = self._thread_limit |
|
275 | 275 |
elif thread.isAlive(): |
276 | 276 |
flying.append(thread) |
277 | 277 |
elif upload_gen: |
... | ... | |
741 | 741 |
:raises ClientError: 409 Container is not empty |
742 | 742 |
""" |
743 | 743 |
self._assert_container() |
744 |
r = self.container_delete(until=until, |
|
744 |
r = self.container_delete( |
|
745 |
until=until, |
|
745 | 746 |
delimiter=delimiter, |
746 | 747 |
success=(204, 404, 409)) |
747 | 748 |
r.release() |
... | ... | |
943 | 944 |
return reply |
944 | 945 |
|
945 | 946 |
def set_object_sharing( |
946 |
self, obj, |
|
947 |
read_permition=False, write_permition=False): |
|
947 |
self, obj,
|
|
948 |
read_permition=False, write_permition=False):
|
|
948 | 949 |
"""Give read/write permisions to an object. |
949 | 950 |
|
950 | 951 |
:param obj: (str) remote object path |
... | ... | |
1018 | 1019 |
source_object=path4url(self.container, obj)) |
1019 | 1020 |
r.release() |
1020 | 1021 |
|
1021 |
def overwrite_object( |
|
1022 |
self, obj, start, end, source_file, |
|
1023 |
upload_cb=None): |
|
1022 |
def overwrite_object(self, obj, start, end, source_file, upload_cb=None): |
|
1024 | 1023 |
"""Overwrite a part of an object from local source file |
1025 | 1024 |
|
1026 | 1025 |
:param obj: (str) remote object path |
... | ... | |
1073 | 1072 |
upload_gen.next() |
1074 | 1073 |
|
1075 | 1074 |
def copy_object( |
1076 |
self, src_container, src_object, dst_container, |
|
1077 |
dst_object=False, |
|
1078 |
source_version=None, |
|
1079 |
public=False, |
|
1080 |
content_type=None, |
|
1081 |
delimiter=None): |
|
1075 |
self, src_container, src_object, dst_container,
|
|
1076 |
dst_object=False,
|
|
1077 |
source_version=None,
|
|
1078 |
public=False,
|
|
1079 |
content_type=None,
|
|
1080 |
delimiter=None):
|
|
1082 | 1081 |
""" |
1083 | 1082 |
:param src_container: (str) source container |
1084 | 1083 |
|
Also available in: Unified diff