3 import sipb_xen_database
8 sipb_xen_database.connect('postgres://sipb-xen@sipb-xen-dev.mit.edu/sipb_xen')
11 p = subprocess.Popen(['/usr/sbin/xm', 'list'], stdout=subprocess.PIPE)
13 output = p.stdout.read()
14 vms = [x.split()[0][2:] for x in output.splitlines() if x.startswith('d_')]
17 def reload_conserver():
18 p = subprocess.Popen(['/etc/init.d/conserver-server', 'reload'], stdout=subprocess.PIPE)
21 if __name__ == '__main__':
22 hostname = socket.getfqdn().lower()
23 config = '\n'.join('console %s { master %s; }' % (vm, hostname)
25 f = open('/etc/conserver/sipb-xen-consoles.cf', 'w')
29 subprocess.call(['/usr/bin/kinit', '-k', '-t', '/etc/krb5.keytab',
30 'host/'+hostname+'@ATHENA.MIT.EDU'])
31 subprocess.call(['/usr/bin/remctl', 'sipb-xen-console.mit.edu',
32 'console', 'update', config])