-# Copyright 2011-2013 GRNET S.A. All rights reserved.
+# Copyright 2011-2014 GRNET S.A. All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
blocksize, blockhash, size, nblocks) = self._get_file_block_info(
f, size, container_info_cache)
(hashes, hmap, offset) = ([], {}, 0)
- if not content_type:
- content_type = 'application/octet-stream'
+ content_type = content_type or 'application/octet-stream'
self._calculate_blocks_for_upload(
*block_info,
sendlog.info('%s blocks missing' % len(missing))
num_of_blocks = len(missing)
missing = self._upload_missing_blocks(
- missing,
- hmap,
- f,
- upload_gen)
+ missing, hmap, f, upload_gen)
if missing:
if num_of_blocks == len(missing):
retries -= 1
for thread in activethreads():
thread.join()
raise
+ self._cb_next()
r = self.object_put(
obj,
finally:
from time import sleep
sleep(2 * len(activethreads()))
+ self._cb_next()
return headers.values()
def truncate_object(self, obj, upto_bytes):
data=block)
headers.append(dict(r.headers))
offset += len(block)
-
- self._cb_next
+ self._cb_next()
+ self._cb_next()
return headers
def copy_object(