From 19bdbc879af6c4eb1b55e3ee2c77d60fc54dc134 Mon Sep 17 00:00:00 2001 From: Andre Sailer Date: Thu, 18 Apr 2024 10:45:07 +0200 Subject: [PATCH 1/2] fix(getMonitoringDB): prevent function returning None --- src/DIRAC/MonitoringSystem/Client/ServerUtils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/DIRAC/MonitoringSystem/Client/ServerUtils.py b/src/DIRAC/MonitoringSystem/Client/ServerUtils.py index 687275d0aad..e762f1a82a5 100644 --- a/src/DIRAC/MonitoringSystem/Client/ServerUtils.py +++ b/src/DIRAC/MonitoringSystem/Client/ServerUtils.py @@ -11,6 +11,8 @@ def getMonitoringDB(): if gMonitoringDB and gMonitoringDB._connected: return gMonitoringDB except Exception: - from DIRAC.Core.Base.Client import Client + pass - return Client(url="Monitoring/Monitoring") + from DIRAC.Core.Base.Client import Client + + return Client(url="Monitoring/Monitoring") From be86e0e862dc38134536c619f749c658785c35e4 Mon Sep 17 00:00:00 2001 From: Andre Sailer Date: Thu, 18 Apr 2024 10:48:06 +0200 Subject: [PATCH 2/2] fix(WMS.ServerUtils.getDB): prevent functions from returning None --- src/DIRAC/WorkloadManagementSystem/Client/ServerUtils.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/DIRAC/WorkloadManagementSystem/Client/ServerUtils.py b/src/DIRAC/WorkloadManagementSystem/Client/ServerUtils.py index 550fec6a138..86a456aa3fe 100644 --- a/src/DIRAC/WorkloadManagementSystem/Client/ServerUtils.py +++ b/src/DIRAC/WorkloadManagementSystem/Client/ServerUtils.py @@ -13,7 +13,9 @@ def getPilotAgentsDB(): if gPilotAgentsDB and gPilotAgentsDB._connected: return gPilotAgentsDB except Exception: - return Client(url="WorkloadManagement/PilotManager") + pass + + return Client(url="WorkloadManagement/PilotManager") def getVirtualMachineDB(): @@ -23,4 +25,6 @@ def getVirtualMachineDB(): if gVirtualMachineDB and gVirtualMachineDB._connected: return gVirtualMachineDB except Exception: - return Client(url="WorkloadManagement/VirtualMachineManager") + pass + + return Client(url="WorkloadManagement/VirtualMachineManager")