Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
chaen committed Oct 3, 2023
1 parent db5a5de commit 5fdca80
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/DIRAC/FrameworkSystem/Utilities/diracx.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ def _get_token(credDict, diracxUrl, /) -> Path:

dirac_properties = list(set(credDict.get("groupProperties", [])) | set(credDict.get("properties", [])))
group = credDict["group"]

# CHRIS
vo = "diracAdmin"
group = "admin"

scopes = [f"vo:{vo}", f"group:{group}"] + [f"property:{prop}" for prop in dirac_properties]

r = requests.get(
Expand Down Expand Up @@ -73,6 +78,7 @@ def TheImpersonator(credDict: dict[str, Any]) -> DiracClient:
"""

diracxUrl = gConfig.getValue("/DiracX/URL")
# CHRIS
diracxUrl = "http://maclhcb35:8000"
token_location = _get_token(credDict, diracxUrl)
pref = DiracxPreferences(url=diracxUrl, credentials_path=token_location)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -485,15 +485,15 @@ def _sendToClient(self, fileID, token, fileHelper=None, raw=False):
# S3 sandbox store, so download it from there before sending it
if filePath.startswith("/S3"):
with TheImpersonator(credDict) as client:
res = client.jobs.get_sandbox_file(filePath)
res = client.jobs.get_sandbox_file(pfn=filePath)
r = requests.get(res.url)
r.raise_for_status()
sbData = r.content
if fileHelper:
from io import BytesIO

result = fileHelper.FDToNetwork(BytesIO(sbData))
fileHelper.oFile.close()
# fileHelper.oFile.close()
return result
if raw:
return sbData
Expand Down

0 comments on commit 5fdca80

Please sign in to comment.