From: Eric Price Date: Wed, 30 Jan 2008 04:33:16 +0000 (-0500) Subject: Modularize cache_acls.py more X-Git-Tag: sipb-xen-www/1~19 X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-web.git/commitdiff_plain/69c6a41bc5488bac84249c5d1adae94099bcd3ec Modularize cache_acls.py more svn path=/trunk/web/; revision=262 --- 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()