diff options
author | Sascha Silbe <sascha-pgp@silbe.org> | 2010-10-17 10:47:58 (GMT) |
---|---|---|
committer | Sascha Silbe <sascha-pgp@silbe.org> | 2010-11-30 10:26:29 (GMT) |
commit | ddedea82d2aedef314bff19aba2d87adc6d273e7 (patch) | |
tree | 1f29cfe88c047423287a247e8804be98a316441a | |
parent | 22d466e64666c0c9372f56aa253d61db7f42cb4a (diff) |
don't delete bundles on storage media (SL #2456)
model.get_file() already wraps data store checkouts in TempFilePath. Because
misc.get_bundle() unconditionally wrapped the path returned by
model.get_file() in TempFilePath as well, bundles located on storage media
(which are referenced by their actual location, not copied or linked) were
deleted after misc.get_bundle() finished.
Tested-by: Simon Schampijer <simon@schampijer.de>
Acked-by: Simon Schampijer <simon@schampijer.de>
-rw-r--r-- | src/jarabe/journal/misc.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/jarabe/journal/misc.py b/src/jarabe/journal/misc.py index 32a2847..d1188c1 100644 --- a/src/jarabe/journal/misc.py +++ b/src/jarabe/journal/misc.py @@ -95,21 +95,21 @@ def get_date(metadata): def get_bundle(metadata): try: if is_activity_bundle(metadata): - file_path = util.TempFilePath(model.get_file(metadata['uid'])) + file_path = model.get_file(metadata['uid']) if not os.path.exists(file_path): logging.warning('Invalid path: %r', file_path) return None return ActivityBundle(file_path) elif is_content_bundle(metadata): - file_path = util.TempFilePath(model.get_file(metadata['uid'])) + file_path = model.get_file(metadata['uid']) if not os.path.exists(file_path): logging.warning('Invalid path: %r', file_path) return None return ContentBundle(file_path) elif is_journal_bundle(metadata): - file_path = util.TempFilePath(model.get_file(metadata['uid'])) + file_path = model.get_file(metadata['uid']) if not os.path.exists(file_path): logging.warning('Invalid path: %r', file_path) return None |