1 #!/usr/bin/python 2 import db 3 4 db = db.db() 5 6 for line in open('machines', 'r').readlines(): 7 (machine, group) = line.rstrip().split() 8 print 'X %s Y %s' % (machine, group) 9 set = { 'machine_group' : group } 10 where = { 'hostname' : machine } 11 db.update('machines', set, where) 12