From 69c6a41bc5488bac84249c5d1adae94099bcd3ec Mon Sep 17 00:00:00 2001 From: Eric Price Date: Tue, 29 Jan 2008 23:33:16 -0500 Subject: [PATCH] Modularize cache_acls.py more svn path=/trunk/web/; revision=262 --- cache_acls.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cache_acls.py b/cache_acls.py index ca0b7c9..c7484d0 100644 --- a/cache_acls.py +++ b/cache_acls.py @@ -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() -- 1.7.9.5