3 import sipb_xen_database
7 sipb_xen_database.connect('postgres://sipb-xen@sipb-xen-dev.mit.edu/sipb_xen')
10 p = subprocess.Popen(['/usr/sbin/xm', 'list'], stdout=subprocess.PIPE)
12 output = p.stdout.read()
13 vms = [x.split()[0][2:] for x in output.splitlines() if x.startswith('d_')]
16 def reload_conserver():
17 p = subprocess.Popen(['/etc/init.d/conserver-server', 'reload'], stdout=subprocess.PIPE)
20 if __name__ == '__main__':
21 f = open('/etc/conserver/sipb-xen-consoles.cf', 'w')
22 f.write('\n'.join('console %s {}' % vm for vm in live_vms()))