Revision b90584d0 snf-pithos-backend/pithos/backends/modular.py
b/snf-pithos-backend/pithos/backends/modular.py | ||
---|---|---|
1193 | 1193 |
self._can_read(user, account, container, name) |
1194 | 1194 |
return (account, container, name) |
1195 | 1195 |
|
1196 |
@backend_method |
|
1197 |
def lock_path(self, path): |
|
1198 |
node = self.node.node_lookup(path, for_update=True) |
|
1199 |
|
|
1200 | 1196 |
@backend_method(autocommit=0) |
1201 | 1197 |
def get_block(self, hash): |
1202 | 1198 |
"""Return a block's data.""" |
... | ... | |
1253 | 1249 |
return account, node |
1254 | 1250 |
|
1255 | 1251 |
def _lookup_container(self, account, container): |
1252 |
for_update = True if self.lock_container_path else False |
|
1256 | 1253 |
path = '/'.join((account, container)) |
1257 |
node = self.node.node_lookup(path) |
|
1254 |
node = self.node.node_lookup(path, for_update)
|
|
1258 | 1255 |
if node is None: |
1259 | 1256 |
raise ItemNotExists('Container does not exist') |
1260 | 1257 |
return path, node |
Also available in: Unified diff