Changeset 863
- Timestamp:
- Aug 4, 2008, 10:16:16 PM (16 years ago)
- Location:
- trunk/packages/sipb-xen-www/code
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/sipb-xen-www/code/cache_acls.py
r589 r863 1 1 #!/usr/bin/python 2 from sipb_xen_database import *2 from invirt.database import * 3 3 import sys 4 4 import getafsgroups … … 68 68 69 69 if __name__ == '__main__': 70 connect( 'postgres://sipb-xen@sipb-xen-dev/sipb_xen')70 connect() 71 71 refreshCache() -
trunk/packages/sipb-xen-www/code/controls.py
r695 r863 3 3 """ 4 4 5 from sipb_xen_database import Machine, Disk, Type, NIC, CDROM, ctx, meta6 5 import validation 7 6 from webcommon import CodeError, InvalidInput … … 14 13 import yaml 15 14 15 from invirt.config import structs as config 16 from invirt.database import Machine, Disk, Type, NIC, CDROM, ctx, meta 17 16 18 # ... and stolen from xend/uuid.py 17 19 def randomUUID(): … … 26 28 # end stolen code 27 29 28 def kinit( username = 'daemon/sipb-xen.mit.edu', keytab = '/etc/sipb-xen.keytab'):30 def kinit(): 29 31 """Kinit with a given username and keytab""" 30 31 p = subprocess.Popen(['kinit', "-k", "-t", keytab, username],32 p = subprocess.Popen(['kinit', "-k", "-t", '/etc/invirt/keytab', 33 'daemon/'+config.web.hostname], 32 34 stderr=subprocess.PIPE) 33 35 e = p.wait() … … 47 49 """ 48 50 checkKinit() 49 p = subprocess.Popen(['remctl', 'remote.mit.edu']51 p = subprocess.Popen(['remctl', config.remote.hostname] 50 52 + list(args), 51 53 stdout=subprocess.PIPE, -
trunk/packages/sipb-xen-www/code/main.py
r799 r863 35 35 import templates 36 36 from Cheetah.Template import Template 37 import sipb_xen_database38 from sipb_xen_database import Machine, CDROM, ctx, connect, MachineAccess, Type, Autoinstall39 37 import validation 40 38 import cache_acls … … 42 40 import controls 43 41 from getafsgroups import getAfsGroupMembers 44 import invirt.config 45 invirt_config = invirt.config.load() 42 import sipb_xen_database 43 from invirt import database 44 from sipb_xen_database import Machine, CDROM, ctx, connect, MachineAccess, Type, Autoinstall 45 from invirt.config import structs as config 46 46 47 47 def pathSplit(path): … … 260 260 host = controls.listHost(machine) 261 261 if host: 262 port = 10003 + [config_host["hostname"] for config_host in invirt_config["hosts"] 263 ].index(host) 262 port = 10003 + [h.hostname for h in config.hosts].index(host) 264 263 else: 265 264 port = 5900 # dummy … … 285 284 return nic.hostname 286 285 elif nic.machine: 287 return nic.machine.name + '. xvm.mit.edu'286 return nic.machine.name + '.' + config.dns.domains[0] 288 287 else: 289 288 return None … … 442 441 ParaVM machines do not support local console access over VNC. To 443 442 access the serial console of these machines, you can SSH with Kerberos 444 to console. xvm.mit.edu, using the name of the machine as your445 username.""" ,443 to console.%s, using the name of the machine as your 444 username.""" % config.dns.domains[0], 446 445 'HVM/ParaVM': """ 447 446 HVM machines use the virtualization features of the processor, while … … 632 631 import subprocess 633 632 634 to = 'xvm@mit.edu'633 to = config.web.errormail 635 634 mail = """To: %s 636 From: root@ xvm.mit.edu635 From: root@%s 637 636 Subject: %s 638 637 639 638 %s 640 """ % (to, subject, body)639 """ % (to, config.web.hostname, subject, body) 641 640 p = subprocess.Popen(['/usr/sbin/sendmail', to], stdin=subprocess.PIPE) 642 641 p.stdin.write(mail) … … 733 732 734 733 def constructor(): 735 connect( 'postgres://sipb-xen@sipb-xen-dev.mit.edu/sipb_xen')734 connect() 736 735 return App 737 736
Note: See TracChangeset
for help on using the changeset viewer.