Revision 33af031c
b/snf-pithos-backend/pithos/backends/modular.py | ||
---|---|---|
639 | 639 |
for t in src_names: |
640 | 640 |
path = '/'.join((account, container, t[0])) |
641 | 641 |
node = t[2] |
642 |
if not self._exists(node): |
|
643 |
continue |
|
642 | 644 |
src_version_id, dest_version_id = self._put_version_duplicate( |
643 | 645 |
user, node, size=0, type='', hash=None, checksum='', |
644 | 646 |
cluster=CLUSTER_DELETED, |
... | ... | |
1178 | 1180 |
return |
1179 | 1181 |
|
1180 | 1182 |
path, node = self._lookup_object(account, container, name) |
1183 |
if not self._exists(node): |
|
1184 |
raise ItemNotExists('Object is deleted.') |
|
1181 | 1185 |
src_version_id, dest_version_id = self._put_version_duplicate( |
1182 | 1186 |
user, node, size=0, type='', hash=None, checksum='', |
1183 | 1187 |
cluster=CLUSTER_DELETED, update_statistics_ancestors_depth=1) |
... | ... | |
1203 | 1207 |
for t in src_names: |
1204 | 1208 |
path = '/'.join((account, container, t[0])) |
1205 | 1209 |
node = t[2] |
1210 |
if not self._exists(node): |
|
1211 |
continue |
|
1206 | 1212 |
src_version_id, dest_version_id = self._put_version_duplicate( |
1207 | 1213 |
user, node, size=0, type='', hash=None, checksum='', |
1208 | 1214 |
cluster=CLUSTER_DELETED, |
... | ... | |
1714 | 1720 |
return False |
1715 | 1721 |
else: |
1716 | 1722 |
return True |
1723 |
|
|
1724 |
def _exists(self, node): |
|
1725 |
try: |
|
1726 |
self._get_version(node) |
|
1727 |
except ItemNotExists: |
|
1728 |
return False |
|
1729 |
else: |
|
1730 |
return True |
Also available in: Unified diff