From ae65c27d3cc1355c27d3b69edc329c386d600b61 Mon Sep 17 00:00:00 2001 From: Christophe Haen Date: Mon, 24 Jul 2023 15:07:15 +0200 Subject: [PATCH 1/2] fix (RSS): allow for Error status in scripts --- .../DataManagementSystem/scripts/dirac_admin_allow_se.py | 2 +- src/DIRAC/DataManagementSystem/scripts/dirac_admin_ban_se.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/DIRAC/DataManagementSystem/scripts/dirac_admin_allow_se.py b/src/DIRAC/DataManagementSystem/scripts/dirac_admin_allow_se.py index 7db39ffade7..60668b8d77b 100755 --- a/src/DIRAC/DataManagementSystem/scripts/dirac_admin_allow_se.py +++ b/src/DIRAC/DataManagementSystem/scripts/dirac_admin_allow_se.py @@ -98,7 +98,7 @@ def main(): DIRAC.exit() STATUS_TYPES = ["ReadAccess", "WriteAccess", "CheckAccess", "RemoveAccess"] - ALLOWED_STATUSES = ["Unknown", "InActive", "Banned", "Probing", "Degraded"] + ALLOWED_STATUSES = ["Unknown", "InActive", "Banned", "Probing", "Degraded", "Error"] statusAllowedDict = {} for statusType in STATUS_TYPES: diff --git a/src/DIRAC/DataManagementSystem/scripts/dirac_admin_ban_se.py b/src/DIRAC/DataManagementSystem/scripts/dirac_admin_ban_se.py index 03ae5e2ce7d..c1d065b6784 100755 --- a/src/DIRAC/DataManagementSystem/scripts/dirac_admin_ban_se.py +++ b/src/DIRAC/DataManagementSystem/scripts/dirac_admin_ban_se.py @@ -115,10 +115,10 @@ def main(): if seOptions["ReadAccess"] == "Banned": gLogger.notice("Read access already banned", se) resR["OK"] = True - elif not seOptions["ReadAccess"] in ["Active", "Degraded", "Probing"]: + elif not seOptions["ReadAccess"] in ["Active", "Degraded", "Probing", "Error"]: gLogger.notice( "Read option for %s is %s, instead of %s" - % (se, seOptions["ReadAccess"], ["Active", "Degraded", "Probing"]) + % (se, seOptions["ReadAccess"], ["Active", "Degraded", "Probing", "Error"]) ) gLogger.notice("Try specifying the command switches") else: From c036311ba9355ffeffc8ce69c7e92a33e979cd40 Mon Sep 17 00:00:00 2001 From: Christophe Haen Date: Mon, 24 Jul 2023 15:08:20 +0200 Subject: [PATCH 2/2] feat (SRR): use proxy for fetching SRR reports --- .../Storage/OccupancyPlugins/WLCGAccountingHTTPJson.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/DIRAC/Resources/Storage/OccupancyPlugins/WLCGAccountingHTTPJson.py b/src/DIRAC/Resources/Storage/OccupancyPlugins/WLCGAccountingHTTPJson.py index c3ab600661a..5e943da7f41 100644 --- a/src/DIRAC/Resources/Storage/OccupancyPlugins/WLCGAccountingHTTPJson.py +++ b/src/DIRAC/Resources/Storage/OccupancyPlugins/WLCGAccountingHTTPJson.py @@ -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 @@ -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: