Created
May 16, 2015 17:12
-
-
Save Philhil/f5e652d4e39ee5088d0f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
nodes_fn = os.path.join(params['dest_dir'], 'nodes.json') | |
# read data from dest dir | |
try: | |
with open(nodes_fn, 'r') as nodedb_handle: | |
nodedb = json.load(nodedb_handle) | |
except IOError: | |
nodedb = {'nodes': dict()} | |
for node_id, node in nodedb['nodes'].items(): | |
node['nodeinfo']['owner']['contact'] = '' | |
# write processed data to dest dir | |
with open(nodes_fn, 'w') as f: | |
json.dump(nodedb, f) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment