Revision 985b9b09 snf-pithos-backend/pithos/backends/lib/sqlalchemy/node.py
b/snf-pithos-backend/pithos/backends/lib/sqlalchemy/node.py | ||
---|---|---|
234 | 234 |
r.close() |
235 | 235 |
return inserted_primary_key |
236 | 236 |
|
237 |
def node_lookup(self, path): |
|
237 |
def node_lookup(self, path, for_update=False):
|
|
238 | 238 |
"""Lookup the current node of the given path. |
239 | 239 |
Return None if the path is not found. |
240 | 240 |
""" |
241 | 241 |
|
242 | 242 |
# Use LIKE for comparison to avoid MySQL problems with trailing spaces. |
243 | 243 |
s = select([self.nodes.c.node], self.nodes.c.path.like( |
244 |
self.escape_like(path), escape=ESCAPE_CHAR)) |
|
244 |
self.escape_like(path), escape=ESCAPE_CHAR), for_update=for_update)
|
|
245 | 245 |
r = self.conn.execute(s) |
246 | 246 |
row = r.fetchone() |
247 | 247 |
r.close() |
Also available in: Unified diff