Revision 6152a559
b/image_creator/kamaki_wrapper.py | ||
---|---|---|
73 | 73 |
raise FatalError("Pithos client: %d %s" % \ |
74 | 74 |
(e.status, e.message)) |
75 | 75 |
try: |
76 |
hash_progress = progress("(1/2) Calculating block hashes:")
|
|
77 |
upload_progress = progress("(2/2) Uploading missing blocks:")
|
|
76 |
hash_progress = progress("(1/2) Calculating block hashes:")
|
|
77 |
upload_progress = progress("(2/2) Uploading missing blocks:")
|
|
78 | 78 |
self.pithos_client.create_object(remote_path, f, size, |
79 |
hash_progress, upload_progress)
|
|
79 |
hash_progress, upload_progress)
|
|
80 | 80 |
self.uploaded_object = "pithos://%s/%s/%s" % \ |
81 | 81 |
(self.account, self.container, remote_path) |
82 | 82 |
except ClientError as e: |
... | ... | |
86 | 86 |
def register(self, metadata): |
87 | 87 |
pass |
88 | 88 |
|
89 |
# vim: set sta sts=4 shiftwidth=4 sw=4 et ai |
|
89 |
# vim: set sta sts=4 shiftwidth=4 sw=4 et ai : |
b/image_creator/util.py | ||
---|---|---|
100 | 100 |
yield # suppress the StopIteration exception |
101 | 101 |
return progress_generator |
102 | 102 |
|
103 |
def md5(filename, size, progress = None): |
|
104 | 103 |
|
105 |
BLOCKSIZE = 2^22 # 4MB |
|
104 |
def md5(filename, size, progress=None): |
|
105 |
|
|
106 |
BLOCKSIZE = 2 ^ 22 # 4MB |
|
106 | 107 |
|
107 | 108 |
md5 = hashlib.md5() |
108 | 109 |
with open(filename, "r") as src: |
Also available in: Unified diff