Comment 7 for bug 1465071

Scott Moser (smoser) wrote :

largely for my own use, heres a little program that prints out what you have

###
#!/usr/bin/python
import json, sys
def go(data, p, tok="/"):
    if 'version_name' in data:
        print("%s %s" % (data['version_name'], p))
    else:
        for i in data:
            if isinstance(data[i], dict):
                go(data[i], p=p + tok + i, tok=tok)

with open(sys.argv[1], "r") as fp:
   d = json.load(fp)
go(d, p="")
###

$ ./go.py /var/lib/maas/boot-resources/current/maas.meta
20150608 /ubuntu/ppc64el/generic/utopic/daily
20150612 /ubuntu/ppc64el/generic/wily/daily
20150611 /ubuntu/ppc64el/generic/trusty/daily
20150612 /ubuntu/ppc64el/generic/vivid/daily
20150608 /ubuntu/ppc64el/hwe-s/utopic/daily
20150612 /ubuntu/ppc64el/hwe-s/wily/daily
20150611 /ubuntu/ppc64el/hwe-s/trusty/daily
20150612 /ubuntu/ppc64el/hwe-s/vivid/daily
20150608 /ubuntu/ppc64el/hwe-p/utopic/daily
20150612 /ubuntu/ppc64el/hwe-p/wily/daily
20150611 /ubuntu/ppc64el/hwe-p/trusty/daily
20150612 /ubuntu/ppc64el/hwe-p/vivid/daily
20150608 /ubuntu/ppc64el/hwe-q/utopic/daily
20150612 /ubuntu/ppc64el/hwe-q/wily/daily
20150611 /ubuntu/ppc64el/hwe-q/trusty/daily
20150612 /ubuntu/ppc64el/hwe-q/vivid/daily
20150612 /ubuntu/ppc64el/hwe-v/wily/daily
20150611 /ubuntu/ppc64el/hwe-v/trusty/daily
20150612 /ubuntu/ppc64el/hwe-v/vivid/daily
20150612 /ubuntu/ppc64el/hwe-w/wily/daily
20150608 /ubuntu/ppc64el/hwe-t/utopic/daily
20150612 /ubuntu/ppc64el/hwe-t/wily/daily
20150611 /ubuntu/ppc64el/hwe-t/trusty/daily
20150612 /ubuntu/ppc64el/hwe-t/vivid/daily
20150608 /ubuntu/ppc64el/hwe-u/utopic/daily
20150612 /ubuntu/ppc64el/hwe-u/wily/daily
20150611 /ubuntu/ppc64el/hwe-u/trusty/daily
20150612 /ubuntu/ppc64el/hwe-u/vivid/daily
20150608 /ubuntu/ppc64el/hwe-r/utopic/daily
20150612 /ubuntu/ppc64el/hwe-r/wily/daily
20150611 /ubuntu/ppc64el/hwe-r/trusty/daily
20150612 /ubuntu/ppc64el/hwe-r/vivid/daily