Modularize cache_acls.py more
authorEric Price <ecprice@mit.edu>
Wed, 30 Jan 2008 04:33:16 +0000 (23:33 -0500)
committerEric Price <ecprice@mit.edu>
Wed, 30 Jan 2008 04:33:16 +0000 (23:33 -0500)
svn path=/trunk/web/; revision=262

cache_acls.py

index ca0b7c9..c7484d0 100644 (file)
@@ -30,9 +30,7 @@ def expandName(name):
         name = 'system:'+name
     return getafsgroups.getAfsGroupMembers(name, 'athena.mit.edu')
 
-if __name__ == '__main__':
-    connect('postgres://sipb-xen@sipb-xen-dev/sipb_xen')
-    
+def refreshCache():
     transaction = ctx.current.create_transaction()
 
     try:
@@ -57,3 +55,7 @@ if __name__ == '__main__':
         # Failed! Rollback all the changes.
         transaction.rollback()
         raise
+
+if __name__ == '__main__':
+    connect('postgres://sipb-xen@sipb-xen-dev/sipb_xen')
+    refreshCache()