Revision c53502b1
b/snf-pithos-backend/pithos/backends/lib/sqlalchemy/node.py | ||
---|---|---|
245 | 245 |
Return () if the path is not found. |
246 | 246 |
""" |
247 | 247 |
|
248 |
if not paths: |
|
249 |
return () |
|
248 | 250 |
# Use LIKE for comparison to avoid MySQL problems with trailing spaces. |
249 | 251 |
s = select([self.nodes.c.node], self.nodes.c.path.in_(paths)) |
250 | 252 |
r = self.conn.execute(s) |
... | ... | |
353 | 355 |
rp = self.conn.execute(s) |
354 | 356 |
nodes = [r[0] for r in rp.fetchall()] |
355 | 357 |
rp.close() |
356 |
s = self.nodes.delete().where(self.nodes.c.node.in_(nodes)) |
|
357 |
self.conn.execute(s).close() |
|
358 |
if nodes: |
|
359 |
s = self.nodes.delete().where(self.nodes.c.node.in_(nodes)) |
|
360 |
self.conn.execute(s).close() |
|
358 | 361 |
|
359 | 362 |
return hashes, size, serials |
360 | 363 |
|
... | ... | |
405 | 408 |
r = self.conn.execute(s) |
406 | 409 |
nodes = r.fetchall() |
407 | 410 |
r.close() |
408 |
s = self.nodes.delete().where(self.nodes.c.node.in_(nodes)) |
|
409 |
self.conn.execute(s).close() |
|
411 |
if nodes: |
|
412 |
s = self.nodes.delete().where(self.nodes.c.node.in_(nodes)) |
|
413 |
self.conn.execute(s).close() |
|
410 | 414 |
|
411 | 415 |
return hashes, size, serials |
412 | 416 |
|
b/snf-pithos-backend/pithos/backends/lib/sqlalchemy/public.py | ||
---|---|---|
87 | 87 |
r.close() |
88 | 88 |
|
89 | 89 |
def public_unset_bulk(self, paths): |
90 |
if not paths: |
|
91 |
return |
|
90 | 92 |
s = self.public.update() |
91 | 93 |
s = s.where(self.public.c.path.in_(paths)) |
92 | 94 |
s = s.values(active=False) |
b/snf-pithos-backend/pithos/backends/lib/sqlalchemy/xfeatures.py | ||
---|---|---|
128 | 128 |
|
129 | 129 |
def xfeature_destroy_bulk(self, paths): |
130 | 130 |
"""Destroy features and all their key, value pairs.""" |
131 |
|
|
131 |
|
|
132 |
if not paths: |
|
133 |
return |
|
132 | 134 |
s = self.xfeatures.delete().where(self.xfeatures.c.path.in_(paths)) |
133 | 135 |
r = self.conn.execute(s) |
134 | 136 |
r.close() |
Also available in: Unified diff