Split FileStore.finalize_transfer() into simpler methods

Bug #717552 reported by Jason Gerard DeRose
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Dmedia
Fix Released
High
Jason Gerard DeRose

Bug Description

Work on the BitTorrent downloader in lp:708418 has brought to light several places where the FileStore API needs tweaks to better fit what the backends need.

For lp:708418, I added the FileStore.finalize_transfer() method. After thinking about needs of S3 downloader/uploader in lp:717544 a bit more, I'm going to split this method into 2 simpler methods:

FileStore.tmp_rename(tmp_fp, chash, ext)

FileStore.tmp_verify_rename(chash, ext)

Pretty simple change, so I'll just explain details in docstrings.

This must be completed prior to lp:717544

Tags: filestore

Related branches

description: updated
Revision history for this message
Jason Gerard DeRose (jderose) wrote :

Okay, ready for review. Rather than "rename", I decided to go with clearer/shorter "move":

FileStore.tmp_move(tmp_fp, chash, ext)
FileStore.tmp_verify_move(chash, ext)

While at it, I also renamed:

FileStore.reltemp() => FileStore.reltmp()
FileStore.temp() => FileStore.tmp()

https://code.launchpad.net/~jderose/dmedia/filestore-tmp-api/+merge/49495

Changed in dmedia:
status: In Progress → Fix Committed
Changed in dmedia:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.