Skip to content

Instantly share code, notes, and snippets.

@Philhil
Created May 16, 2015 17:12
Show Gist options
  • Save Philhil/f5e652d4e39ee5088d0f to your computer and use it in GitHub Desktop.
Save Philhil/f5e652d4e39ee5088d0f to your computer and use it in GitHub Desktop.
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