Skip to content

Instantly share code, notes, and snippets.

@concubidated
Created November 7, 2014 23:38
Show Gist options
  • Save concubidated/cb101a473c5a02ec1988 to your computer and use it in GitHub Desktop.
Save concubidated/cb101a473c5a02ec1988 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import sys
import simplejson as json
obj=json.load(sys.stdin)
epoch = str(obj['monmap']['epoch'])
print "dumped monmap epoch "+epoch
print "epoch "+epoch
print "fsid "+obj['monmap']['fsid']
print "last changed "+obj['monmap']['modified']
print "created "+obj['monmap']['created']
for mons in obj['monmap']['mons']:
print str(mons['rank'])+":",
print mons['addr'],
print "mon."+mons['name']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment