Page MenuHomePhabricator
Paste P3876

find all precise
ActivePublic

Authored by chasemp on Aug 23 2016, 1:32 PM.
#!/usr/bin/python
import argparse
import fileinput
import subprocess
import novastats
parser = argparse.ArgumentParser(description='Check salt status for instances')
parser.add_argument('--project',
dest='project',
help='limit stats to a single project',
default=None)
args = parser.parse_args()
bigDict = novastats.instanceData(args.project)
good = []
bad = []
broken = []
down = []
for ID in bigDict.keys():
if bigDict[ID]['image'].lower().find('precise') != -1:
print "%s:%s %s %s" % (bigDict[ID]['tenant_id'], bigDict[ID]['name'], ID, bigDict[ID]['image'])