From f94b71b7719c39fbb505ee85e24e00ea1b9754d4 Mon Sep 17 00:00:00 2001 From: Chris Burr Date: Wed, 16 Apr 2025 21:02:42 +0200 Subject: [PATCH 1/2] Stop using session --- src/DIRAC/FrameworkSystem/Utilities/diracx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DIRAC/FrameworkSystem/Utilities/diracx.py b/src/DIRAC/FrameworkSystem/Utilities/diracx.py index 2a8d5d24c16..b4fe95eb44f 100644 --- a/src/DIRAC/FrameworkSystem/Utilities/diracx.py +++ b/src/DIRAC/FrameworkSystem/Utilities/diracx.py @@ -117,7 +117,7 @@ def get_token( vo = Registry.getVOForGroup(group) scopes = [f"vo:{vo}", f"group:{group}"] + [f"property:{prop}" for prop in dirac_properties] - r = diracx_session.get( + r = requests.get( f"{diracxUrl}/api/auth/legacy-exchange", params={ "preferred_username": username, From cbfdaf528e860f4fbdcfa45f9c195ef56f8ccb6e Mon Sep 17 00:00:00 2001 From: Christophe Haen Date: Thu, 17 Apr 2025 13:44:12 +0200 Subject: [PATCH 2/2] reuse session --- src/DIRAC/FrameworkSystem/Utilities/diracx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DIRAC/FrameworkSystem/Utilities/diracx.py b/src/DIRAC/FrameworkSystem/Utilities/diracx.py index b4fe95eb44f..2a8d5d24c16 100644 --- a/src/DIRAC/FrameworkSystem/Utilities/diracx.py +++ b/src/DIRAC/FrameworkSystem/Utilities/diracx.py @@ -117,7 +117,7 @@ def get_token( vo = Registry.getVOForGroup(group) scopes = [f"vo:{vo}", f"group:{group}"] + [f"property:{prop}" for prop in dirac_properties] - r = requests.get( + r = diracx_session.get( f"{diracxUrl}/api/auth/legacy-exchange", params={ "preferred_username": username,