cuckoobox/cuckoo — pull request #85 by tnz (2013-03-20 18:36:11+00:00)
Title: db.find_sample() already returns a single object

Hi,

Starting the REST api and trying to use it gives an error in files_view when searching for a SHA256 hash:
```
> utils/api.py
Bottle server starting up (using WSGIRefServer())...
Listening on http://localhost:8090/
Hit Ctrl-C to quit.
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/bottle.py", line 737, in _handle
return route.call(**args)
File "/usr/lib/python2.7/site-packages/bottle.py", line 1506, in wrapper
rv = callback(*a, **ka)
File "/usr/lib/python2.7/site-packages/bottle.py", line 1456, in wrapper
rv = callback(*a, **ka)
File "utils/api.py", line 189, in files_view
sample = db.find_sample(sha256=sha256)[0]
TypeError: 'Sample' object does not support indexing
```
(line numbers here are from the "master" branch as it seems)

The commit I've tried to make here fixed it for me, so this github stuff works out, feel free...

Cheers,
Thiemo