Skip to content

Commit

Permalink
Merge pull request #765 from fstagni/pylint32
Browse files Browse the repository at this point in the history
fix: fix pylint3.2 errors
  • Loading branch information
fstagni authored May 16, 2024
2 parents 11c8228 + d78a4ff commit 57f4fd2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/WebAppDIRAC/WebApp/handler/JobMonitorHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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":
Expand Down
3 changes: 2 additions & 1 deletion src/WebAppDIRAC/WebApp/handler/TokenManagerHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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}))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down
6 changes: 3 additions & 3 deletions src/WebAppDIRAC/WebApp/handler/VMDiracHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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):
Expand All @@ -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}

0 comments on commit 57f4fd2

Please sign in to comment.