[Linaro-validation] RFC Patch: lava with no media files
Andy Doan
andy.doan at linaro.org
Fri Apr 20 23:10:43 UTC 2012
I was trying to get my local LAVA instance to work with our lab's data
base dump. So I had the DB, but not all the media files. LAVA almost
works when you do this, but I hit two small issues that prevented me
from looking at bundle streams and it their test runs.
I realize this is an edge case, but its handy for when you want to test
with a real database, but don't want all the media files. I'm not sure
this is the exact way we want to fix this, so rather than do a merge
proposal I thought I'd get your thoughts on the patch first.
There were two main issues in the code:
bundle_detail wants to get the "document format" for the media file
associated with the bundle. Since the file didn't exist we hit an
exception. I added a small check to the get_document_format to handle
this by returning "n/a".
bundle_detail and test_run_detail wanted to display the size of media
files. This calls a new function content_size which will catch an error
if the file doesn't exist and simply return 0.
I'm not sure if this patch is doing to good a job of hiding the fact an
error does exist. Maybe we should put a conditional in the template file
to display an error when the file doesn't exist also?
-andy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: no-media.patch
Type: text/x-patch
Size: 1803 bytes
Desc: not available
URL: <http://lists.linaro.org/pipermail/linaro-validation/attachments/20120420/b1cbe219/attachment.bin>
More information about the linaro-validation
mailing list