projects
/
invirt/packages/invirt-console.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
use invirt.config in sipb-xen-console-server
[invirt/packages/invirt-console.git]
/
files
/
usr
/
sbin
/
sipb-xen-update-conserver
diff --git
a/files/usr/sbin/sipb-xen-update-conserver
b/files/usr/sbin/sipb-xen-update-conserver
index
1d3580b
..
081bb1c
100755
(executable)
--- a/
files/usr/sbin/sipb-xen-update-conserver
+++ b/
files/usr/sbin/sipb-xen-update-conserver
@@
-4,6
+4,7
@@
import sipb_xen_database
import subprocess
import os
import socket
import subprocess
import os
import socket
+from invirt.config import structs as config
sipb_xen_database.connect('postgres://sipb-xen@sipb-xen-dev.mit.edu/sipb_xen')
sipb_xen_database.connect('postgres://sipb-xen@sipb-xen-dev.mit.edu/sipb_xen')
@@
-20,6
+21,8
@@
def reload_conserver():
if __name__ == '__main__':
hostname = socket.getfqdn().lower()
if __name__ == '__main__':
hostname = socket.getfqdn().lower()
+ realm = config.authn[0].realm
+ principal = 'host/'+hostname+'@'+realm
config = '\n'.join('console %s { master %s; }' % (vm, hostname)
for vm in live_vms())
f = open('/etc/conserver/sipb-xen-consoles.cf', 'w')
config = '\n'.join('console %s { master %s; }' % (vm, hostname)
for vm in live_vms())
f = open('/etc/conserver/sipb-xen-consoles.cf', 'w')
@@
-27,6
+30,6
@@
if __name__ == '__main__':
f.close()
reload_conserver()
subprocess.call(['/usr/bin/kinit', '-k', '-t', '/etc/krb5.keytab',
f.close()
reload_conserver()
subprocess.call(['/usr/bin/kinit', '-k', '-t', '/etc/krb5.keytab',
- 'host/'+hostname+'@ATHENA.MIT.EDU'])
+ principal])
subprocess.call(['/usr/bin/remctl', 'sipb-xen-console.mit.edu',
'console', 'update', config])
subprocess.call(['/usr/bin/remctl', 'sipb-xen-console.mit.edu',
'console', 'update', config])