Skip to content

Commit c99c6f3

Browse files
committed
osint_runner: remove bson and just use json.dump
I'm assuming bson and json_util were used when mongodb and the webui were in the works. In any case, this isn't neccessary (tmk) and we can cut out the unneeded import, just use json.dump and have slightly cleaner output writing. This will also alphabetize the json output.
1 parent e0ed16e commit c99c6f3

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

osint_runner.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from glob import glob
66
from collections import OrderedDict
77
from datetime import datetime
8-
from bson import json_util
98

109

1110
def run(component, module_dir, m_input, output = None):
@@ -39,7 +38,6 @@ def run(component, module_dir, m_input, output = None):
3938
if not os.path.exists(filepath):
4039
os.makedirs(filepath)
4140
file = "%s/%s" % (filepath, filename)
42-
fh = open("%s/%s" % (filepath, filename), "w")
43-
fh.write(json.dumps(json_output, default=json_util.default, indent = 4))
44-
fh.close()
41+
with open(file, "w") as fh:
42+
json.dump(json_output, fh, indent=4, sort_keys=True)
4543
print "JSON report saved to %s/%s" % (filepath, filename)

0 commit comments

Comments
 (0)