This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git


The following commit(s) were added to refs/heads/master by this push:
     new b313a0b1c restore scripts/ApacheAccessHandler.py to py2 compatible
b313a0b1c is described below

commit b313a0b1c599a6c7f07780d19b34e88723a98064
Author: Dave Brondsema <[email protected]>
AuthorDate: Fri Feb 10 11:11:47 2023 -0500

    restore scripts/ApacheAccessHandler.py to py2 compatible
---
 scripts/ApacheAccessHandler.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/scripts/ApacheAccessHandler.py b/scripts/ApacheAccessHandler.py
index da0bb78e5..63ed8431f 100644
--- a/scripts/ApacheAccessHandler.py
+++ b/scripts/ApacheAccessHandler.py
@@ -18,6 +18,8 @@
 """
 An Apache authorization handler for Allura
 
+Currently python2 only.  See 
https://forge-allura.apache.org/p/allura/tickets/8352/
+
 * This needs python-requests in the modpython path
 * Check fuse/accessfs.py for more details on the path mangling
   magic
@@ -49,7 +51,7 @@ def load_requests_lib(req):
         try:
             exec(compile(open(activate_this, "rb").read(), activate_this, 
'exec'), {'__file__': activate_this})
         except Exception as e:
-            log(req, f"Couldn't activate venv via {activate_this}: {repr(e)}")
+            log(req, "Couldn't activate venv via {}: {}".format(activate_this, 
repr(e)))
     global requests
     import requests as requests_lib
     requests = requests_lib
@@ -64,7 +66,7 @@ def mangle(path):
     if len(parts) < 4:
         return None
     scm, nbhd, proj, rest = parts[0], parts[1], parts[2], parts[3:]
-    parts = [f'/SCM/{proj}.{nbhd}'] + rest
+    parts = ['/SCM/{}.{}'.format(proj, nbhd)] + rest
     return '/'.join(parts)
 
 
@@ -191,7 +193,7 @@ def check_permissions(req):
     permission = get_permission_name(req_path, req_query, req.method)
     authorized = cred.get(permission, False)
 
-    log(req, f"{r.url} -> {cred} -> {permission} -> authorized:{authorized}")
+    log(req, "{} -> {} -> {} -> authorized:{}".format(r.url, cred, permission, 
authorized))
     return authorized
 
 

Reply via email to