From 703e83c521982e9c6ebb337694074e0abaf3c7ff Mon Sep 17 00:00:00 2001
From: Evan Broder <broder@mit.edu>
Date: Mon, 7 Dec 2009 21:33:43 -0500
Subject: [PATCH 1/1] Store AFS cell configuration at authz.afs.cells instead
 of just authz.cells, to be more clear about purpose.

svn path=/trunk/packages/invirt-web/; revision=2590
---
 code/cache_acls.py   |    2 +-
 code/getafsgroups.py |    2 +-
 code/validation.py   |    2 +-
 invirt-cache-acls    |    4 ++--
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/code/cache_acls.py b/code/cache_acls.py
index 75f4720..7ae4ac8 100755
--- a/code/cache_acls.py
+++ b/code/cache_acls.py
@@ -39,7 +39,7 @@ def expandName(name):
             return [name]
         return []
     try:
-        return getafsgroups.getAfsGroupMembers(name, config.authz.cells[0].cell)
+        return getafsgroups.getAfsGroupMembers(name, config.authz.afs.cells[0].cell)
     except getafsgroups.AfsProcessError:
         return []
 
diff --git a/code/getafsgroups.py b/code/getafsgroups.py
index 21de4d7..fed3a6b 100755
--- a/code/getafsgroups.py
+++ b/code/getafsgroups.py
@@ -30,7 +30,7 @@ class AfsProcessError(Exception):
 
 def getAfsGroupMembers(group, cell):
     encrypt = True
-    for c in config.authz.cells:
+    for c in config.authz.afs.cells:
         if c.cell == cell and hasattr(c, 'auth'):
             encrypt = c.auth
     subprocess.check_call(['aklog', cell], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
diff --git a/code/validation.py b/code/validation.py
index 4cbc7c0..875115c 100644
--- a/code/validation.py
+++ b/code/validation.py
@@ -222,7 +222,7 @@ def testAdmin(user, admin, machine):
             return admin
         admin = 'system:' + admin
     try:
-        if user in getafsgroups.getAfsGroupMembers(admin, config.authz.cells[0].cell):
+        if user in getafsgroups.getAfsGroupMembers(admin, config.authz.afs.cells[0].cell):
             return admin
     except getafsgroups.AfsProcessError, e:
         errmsg = str(e)
diff --git a/invirt-cache-acls b/invirt-cache-acls
index 922d9ba..79a7650 100755
--- a/invirt-cache-acls
+++ b/invirt-cache-acls
@@ -1,7 +1,7 @@
 #!/bin/sh
 cells () {
-  for i in $(invirt-getconf -l authz.cells); do
-    invirt-getconf authz.cells.$i.cell
+  for i in $(invirt-getconf -l authz.afs.cells); do
+    invirt-getconf authz.afs.cells.$i.cell
   done
 }
 kinit -k -t /etc/invirt/keytab daemon/$(hostname -f)
-- 
1.7.9.5