6 from invirt.config import structs as config
9 p = subprocess.Popen(['/usr/sbin/xm', 'list'], stdout=subprocess.PIPE)
11 output = p.stdout.read()
12 vms = [x.split()[0][2:] for x in output.splitlines() if x.startswith('d_')]
15 def reload_conserver():
16 p = subprocess.Popen(['invoke-rc.d', 'conserver-server', 'reload'], stdout=subprocess.PIPE)
19 if __name__ == '__main__':
20 hostname = socket.getfqdn().lower()
21 realm = config.authn[0].realm
22 principal = 'host/'+hostname+'@'+realm
23 conftext = '\n'.join('console %s { master %s; }' % (vm, hostname)
25 f = open('/etc/conserver/invirt-consoles.cf', 'w')
29 subprocess.call(['/usr/bin/kinit', '-k', '-t', '/etc/krb5.keytab',
31 subprocess.call(['/usr/bin/remctl', config.console.hostname,
32 'console', 'update', conftext])