From d78a4ffdb4f6ac78683d2299f5b2ec6c95f70a37 Mon Sep 17 00:00:00 2001 From: Federico Stagni Date: Thu, 16 May 2024 12:24:26 +0200 Subject: [PATCH] fix: fix pylint3.2 errors --- src/WebAppDIRAC/WebApp/handler/JobMonitorHandler.py | 2 +- src/WebAppDIRAC/WebApp/handler/TokenManagerHandler.py | 3 ++- .../WebApp/handler/TransformationMonitorHandler.py | 1 + src/WebAppDIRAC/WebApp/handler/VMDiracHandler.py | 6 +++--- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/WebAppDIRAC/WebApp/handler/JobMonitorHandler.py b/src/WebAppDIRAC/WebApp/handler/JobMonitorHandler.py index fe2457ba..6a2e2413 100644 --- a/src/WebAppDIRAC/WebApp/handler/JobMonitorHandler.py +++ b/src/WebAppDIRAC/WebApp/handler/JobMonitorHandler.py @@ -4,7 +4,6 @@ from DIRAC import gConfig, gLogger from DIRAC.Core.Utilities import DictCache from DIRAC.Core.Utilities.Graphs.Palette import Palette -from DIRAC.RequestManagementSystem.Client.Request import Request from DIRAC.RequestManagementSystem.Client.ReqClient import ReqClient from DIRAC.WorkloadManagementSystem.Client.JobMonitoringClient import JobMonitoringClient from DIRAC.WorkloadManagementSystem.Client.JobManagerClient import JobManagerClient @@ -284,6 +283,7 @@ def web_jobAction(self, JobID): ids = [int(i) for i in ids] RPC = JobManagerClient() + result = None if self.get_argument("action") == "delete": result = RPC.deleteJob(ids) elif self.get_argument("action") == "kill": diff --git a/src/WebAppDIRAC/WebApp/handler/TokenManagerHandler.py b/src/WebAppDIRAC/WebApp/handler/TokenManagerHandler.py index 4d6f657b..2b742cfe 100644 --- a/src/WebAppDIRAC/WebApp/handler/TokenManagerHandler.py +++ b/src/WebAppDIRAC/WebApp/handler/TokenManagerHandler.py @@ -2,7 +2,7 @@ import datetime import jwt -from DIRAC import gConfig, gLogger +from DIRAC import gLogger from DIRAC.ConfigurationSystem.Client.Helpers.Registry import getAllUsers from DIRAC.FrameworkSystem.Client.TokenManagerClient import TokenManagerClient @@ -93,6 +93,7 @@ def web_tokenData(self, userid: str, data_kind: str) -> dict: :return: dict """ if (result := self.tm.getTokensByUserID(userid))["OK"]: + res = "" if data_kind == "getAccessToken": res = ( str(jwt.decode(result["Value"][0]["access_token"], options={"verify_signature": False})) diff --git a/src/WebAppDIRAC/WebApp/handler/TransformationMonitorHandler.py b/src/WebAppDIRAC/WebApp/handler/TransformationMonitorHandler.py index 34ae48e0..091e9888 100644 --- a/src/WebAppDIRAC/WebApp/handler/TransformationMonitorHandler.py +++ b/src/WebAppDIRAC/WebApp/handler/TransformationMonitorHandler.py @@ -213,6 +213,7 @@ def web_executeOperation(self, action, ids): def __fileRetry(self, prodid, mode): tsClient = TransformationClient() + result = None if mode == "proc": result = tsClient.getTransformationFilesCount(prodid, "ErrorCount", {"Status": "Processed"}) elif mode == "not": diff --git a/src/WebAppDIRAC/WebApp/handler/VMDiracHandler.py b/src/WebAppDIRAC/WebApp/handler/VMDiracHandler.py index 2fa487e9..86961cb5 100644 --- a/src/WebAppDIRAC/WebApp/handler/VMDiracHandler.py +++ b/src/WebAppDIRAC/WebApp/handler/VMDiracHandler.py @@ -111,7 +111,7 @@ def web_getRunningInstancesBEPHistory(self, bucketSize=900, timespan=86400): eTime = TimeUtilities.toEpoch(record[0]) if eTime < olderThan: rL = [eTime, record[1], int(record[2])] - data.append(rL) + data.append(rL) return {"success": "true", "data": data} def web_getRunningInstancesByRunningPodHistory(self, bucketSize=900, timespan=86400): @@ -124,7 +124,7 @@ def web_getRunningInstancesByRunningPodHistory(self, bucketSize=900, timespan=86 eTime = TimeUtilities.toEpoch(record[0]) if eTime < olderThan: rL = [eTime, record[1], int(record[2])] - data.append(rL) + data.append(rL) return {"success": "true", "data": data} def web_getRunningInstancesByImageHistory(self, bucketSize=900, timespan=86400): @@ -137,5 +137,5 @@ def web_getRunningInstancesByImageHistory(self, bucketSize=900, timespan=86400): eTime = TimeUtilities.toEpoch(record[0]) if eTime < olderThan: rL = [eTime, record[1], int(record[2])] - data.append(rL) + data.append(rL) return {"success": "true", "data": data}