spender-sandbox / cuckoo-modified

Modified edition of cuckoo
394 stars 178 forks source link

import missing in retention.py? #149

Open mallorybobalice opened 8 years ago

mallorybobalice commented 8 years ago

modules/reporting/retention.py needs an extra import.

from bson.objectid import ObjectId

2016-05-23 18:29:15,860 [lib.cuckoo.core.plugins] ERROR: Failed to run the reporting module "Retention": Traceback (most recent call last): File "kittenscsb1utils/../lib/cuckoo/core/plugins.py", line 628, in process current.run(self.results) File "kittenscsb1utils/../modules/reporting/retention.py", line 204, in run delete_mongo_data(curtask, lastTask) File "kittenscsb1utils/../modules/reporting/retention.py", line 60, in delete_mongo_data results_db.analysis.remove({"_id": ObjectId(analysis["_id"])}) NameError: global name 'ObjectId' is not defined

mallorybobalice commented 8 years ago

or is this the odd bit where I've accidentally previously installed bson separately, then realized my mistake, reinstalled the right version but at the same didn't follow the use the bundled pymongo? one

KillerInstinct commented 8 years ago

Yes, object ID is in Mongos version of BSON. Make sure you have pip uninstalled bson, mongodb and then pip install mongodb (or w/e the pip package is called)