Revision 3373fb59 snf-pithos-backend/pithos/backends/lib/hashfiler/fileblocker.py
b/snf-pithos-backend/pithos/backends/lib/hashfiler/fileblocker.py | ||
---|---|---|
54 | 54 |
|
55 | 55 |
monkey.patch_Request() |
56 | 56 |
|
57 |
ARCHIPELAGO_CONF = '/etc/archipelago/archipelago.conf' |
|
57 | 58 |
|
58 | 59 |
class FileBlocker(object): |
59 | 60 |
"""Blocker. |
... | ... | |
90 | 91 |
self.hashtype = hashtype |
91 | 92 |
self.hashlen = len(emptyhash) |
92 | 93 |
self.emptyhash = emptyhash |
94 |
config = {} |
|
95 |
execfile(ARCHIPELAGO_CONF, config) |
|
96 |
self.blockerb_dstport = config['mapperd']['blockerb_port'] |
|
93 | 97 |
|
94 | 98 |
def _pad(self, block): |
95 | 99 |
return block + ('\x00' * (self.blocksize - len(block))) |
... | ... | |
135 | 139 |
ioctx_pool = glue.WorkerGlue.ioctx_pool |
136 | 140 |
ioctx = ioctx_pool.pool_get() |
137 | 141 |
archip_emptyhash = hexlify(self.emptyhash) |
138 |
dst_port = 1000
|
|
142 |
dst_port = self.blockerb_dstport
|
|
139 | 143 |
|
140 | 144 |
for h in hashes: |
141 | 145 |
if h == archip_emptyhash: |
Also available in: Unified diff