Skip to content

Commit

Permalink
feat (SRR): use proxy for fetching SRR reports
Browse files Browse the repository at this point in the history
  • Loading branch information
chaen committed Jul 24, 2023
1 parent ae65c27 commit c036311
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import os
import requests

from DIRAC.Core.Security.Locations import getCAsLocation
from DIRAC.Core.Security.Locations import getCAsLocation, getProxyLocation
from DIRAC.Resources.Storage.OccupancyPlugins.WLCGAccountingJson import WLCGAccountingJson


Expand Down Expand Up @@ -39,11 +39,11 @@ def _downloadJsonFile(self, occupancyLFN, filePath):
:param filePath: destination path for the file
"""

try:
with open(filePath, "w") as fd:
caPath = getCAsLocation()
res = requests.get(occupancyLFN, verify=caPath)
userProxy = getProxyLocation()
res = requests.get(occupancyLFN, cert=userProxy, verify=caPath)
res.raise_for_status()
fd.write(res.text)
except Exception as e:
Expand Down

0 comments on commit c036311

Please sign in to comment.