From 4968927e695e31396ba840f07a61fab1424c5c76 Mon Sep 17 00:00:00 2001 From: Yang Zhang Date: Fri, 8 Aug 2008 02:41:38 -0400 Subject: [PATCH] * further integration of invirt.config svn path=/trunk/packages/sipb-xen-www/; revision=879 --- code/cache_acls.py | 3 ++- code/controls.py | 2 +- code/main.py | 2 +- code/validation.py | 3 ++- config.todo | 4 ---- debian/changelog | 12 ++++++++++++ 6 files changed, 18 insertions(+), 8 deletions(-) diff --git a/code/cache_acls.py b/code/cache_acls.py index 130f359..2b3fd6c 100644 --- a/code/cache_acls.py +++ b/code/cache_acls.py @@ -1,5 +1,6 @@ #!/usr/bin/python from invirt.database import * +from invirt.config import structs as config import sys import getafsgroups import subprocess @@ -29,7 +30,7 @@ def expandName(name): return [name] return [] try: - return getafsgroups.getAfsGroupMembers(name, 'athena.mit.edu') + return getafsgroups.getAfsGroupMembers(name, config.authz[0].cell) except getafsgroups.AfsProcessError: return [] diff --git a/code/controls.py b/code/controls.py index d4cc13b..8a5f1ef 100644 --- a/code/controls.py +++ b/code/controls.py @@ -132,7 +132,7 @@ def createVm(username, state, owner, contact, name, description, memory, disksiz open_nics = NIC.select_by(machine_id=None) if not open_nics: #No IPs left! raise CodeError("No IP addresses left! " - "Contact xvm@mit.edu.") + "Contact %s." % config.web.errormail) nic = open_nics[0] nic.machine_id = machine.machine_id nic.hostname = name diff --git a/code/main.py b/code/main.py index f6f0bff..78ca14f 100755 --- a/code/main.py +++ b/code/main.py @@ -649,7 +649,7 @@ def show_error(op, username, fields, err, emsg, traceback): d = dict(op=op, user=username, fields=fields, errorMessage=str(err), stderr=emsg, traceback=traceback) details = templates.error_raw(searchList=[d]) - if username not in ('price', 'ecprice', 'andersk'): #add yourself at will + if username not in config.web.errormail_exclude: send_error_mail('xvm error on %s for %s: %s' % (op, username, err), details) d['details'] = details diff --git a/code/validation.py b/code/validation.py index 2e6c7c3..f6e4a59 100644 --- a/code/validation.py +++ b/code/validation.py @@ -5,6 +5,7 @@ import getafsgroups import re import string from invirt.database import Machine, NIC, Type, Disk, CDROM, Autoinstall +from invirt.config import structs as config from webcommon import InvalidInput MAX_MEMORY_TOTAL = 512 @@ -223,7 +224,7 @@ def testAdmin(user, admin, machine): return admin admin = 'system:' + admin try: - if user in getafsgroups.getAfsGroupMembers(admin, 'athena.mit.edu'): + if user in getafsgroups.getAfsGroupMembers(admin, config.authz[0].cell): return admin except getafsgroups.AfsProcessError, e: errmsg = str(e) diff --git a/config.todo b/config.todo index a51b66b..d888265 100644 --- a/config.todo +++ b/config.todo @@ -10,10 +10,6 @@ files/etc/apache2/sites-available/ssl: trac uri files/etc/apache2/sites-available/svn: contact email files/etc/apache2/sites-available/svn: svn repo path files/etc/init.d/apache2.invirt: afs cell (for svn?) -code/cache_acls.py: afs cell for authz -code/controls.py: xvm@mit.edu -code/main.py: error-mail blacklist: price, etc -code/validation.py: afs cell for authz code/templates/error.tmpl: xvm@mit.edu code/templates/help.tmpl: assumes trac code/templates/list.tmpl: SIPB Virtual Servers diff --git a/debian/changelog b/debian/changelog index ea6d481..781165d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +sipb-xen-www (3.9) unstable; urgency=low + + * further integration of invirt.config + + -- Yang Zhang Fri, 8 Aug 2008 02:39:15 -0400 + +sipb-xen-www (3.8) unstable; urgency=low + + * sipb_xen_database -> invirt.database in cache_acls.py + + -- Yang Zhang Sun, 3 Aug 2008 19:45:19 -0400 + sipb-xen-www (3.7) unstable; urgency=low uncommitted changes in /etc/apache2 on xvm.mit.edu: -- 1.7.9.5