Skip to content

Commit

Permalink
sort probes when writing to file
Browse files Browse the repository at this point in the history
to make diff-ing fingerprints in future easy, it's good to keep the
order of probe results deterministic, so sort them alphabetically by
name
  • Loading branch information
tomato42 committed Sep 10, 2016
1 parent f810b95 commit 0ee153b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions probe_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ def add_fingerprint(description, probes):
f = open(os.path.join(fingerprint_dir, filename), 'w')
f.write('Description: %s\n' % description)
f.write('\n')
for probe in probes.keys():
f.write('%s: %s\n' % (probe, probes[probe]))
for probe, result in sorted(probes.items()):
f.write('%s: %s\n' % (probe, result))
f.close()

return os.path.join(fingerprint_dir, filename)
Expand Down

0 comments on commit 0ee153b

Please sign in to comment.