Skip to content

Commit 9e8cb8f

Browse files
fstagniweb-flow
authored andcommitted
sweep: #690 ResourceSummaryHandler: convert of string to list of strings
1 parent b155742 commit 9e8cb8f

3 files changed

Lines changed: 19 additions & 13 deletions

File tree

.github/workflows/codestyle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
with:
3131
repository: DIRACGrid/DIRAC
3232
path: .DIRAC
33-
ref: integration
33+
ref: rel-v8r0
3434

3535
- name: Get DIRAC
3636
run: |

.pylintrc

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Python code to execute, usually for sys.path manipulation such as
66
# pygtk.require().
7-
init-hook='import sys; sys.path.append("$WORKSPACE/DIRAC/WorkloadManagementSystem/PilotAgent")'
7+
# init-hook='import sys; sys.path.append("$WORKSPACE/DIRAC/WorkloadManagementSystem/PilotAgent")'
88

99
# Add <file or directory> to the black list. It should be a base name, not a
1010
# path. You may set this option multiple times.
@@ -47,7 +47,7 @@ output-format=colorized
4747
files-output=no
4848

4949
# Tells whether to display a full report or only the messages
50-
reports=yes
50+
reports=no
5151

5252
# Python expression which should return a note less than 10 (10 is the highest
5353
# note). You have access to the variables errors warning, statement which
@@ -63,7 +63,7 @@ bad-functions=map,filter,apply,input,raw_input,has_key
6363

6464
# Regular expression which should only match correct module names
6565
# Added last option, to take into account script names
66-
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+)|([dirac_-][a-zA-Z_-]+))$
66+
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+)|([dirac_-][a-zA-Z_-]+)|(Test_[a-zA-Z_-]+))$
6767

6868
# Regular expression which should only match correct module level names
6969
#const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__)|(g[A-Z][a-zA-Z0-9]*))$
@@ -73,7 +73,7 @@ const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__)|(g[A-Z][a-zA-Z0-9]*)|[a-z_][A-Za-z0-9_]*)
7373
class-rgx=[A-Z_][a-zA-Z0-9]+$
7474

7575
# Regular expression which should only match correct function names
76-
function-rgx=[a-z_][A-Za-z0-9_]{2,30}$
76+
function-rgx=(([a-z_][A-Za-z0-9_]{2,30}$)|(test_[A-Za-z0-9_]{2,50}$))
7777

7878
# Regular expression which should only match correct method names
7979
method-rgx=[a-z_][A-Za-z0-9_]{2,30}$
@@ -105,15 +105,11 @@ no-docstring-rgx=__.*__
105105
[FORMAT]
106106

107107
# Maximum number of characters on a single line.
108-
max-line-length=120
108+
max-line-length=130
109109

110110
# Maximum number of lines in a module
111111
max-module-lines=1200
112112

113-
# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
114-
# tab).
115-
indent-string=' '
116-
117113
[MISCELLANEOUS]
118114

119115
# List of note tags to take in consideration, separated by a comma.

src/WebAppDIRAC/WebApp/handler/ResourceSummaryHandler.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import collections
2-
import json
32
import datetime
3+
import json
44

55
from DIRAC import gLogger
66
from DIRAC.ResourceStatusSystem.Client.PublisherClient import PublisherClient
77
from DIRAC.ResourceStatusSystem.PolicySystem.StateMachine import RSSMachine
8-
98
from WebAppDIRAC.Lib.WebHandler import WebHandler
109

1110

@@ -34,7 +33,7 @@ def _getSelectionData(self, **kwargs) -> dict:
3433
for key, value in callback.items():
3534

3635
callback[key] = sorted([item] for item in list(value))
37-
callback[key] = [["All"]] + callback[key]
36+
callback[key] = [["all"]] + callback[key]
3837

3938
return callback
4039

@@ -312,6 +311,17 @@ def web_action(self, action=None, **kwargs):
312311

313312
def web_getResourceSummaryData(self, name=None, status=None, elementType=None, statusType=None, tokenOwner=None):
314313
"""This method returns the data required to fill the grid."""
314+
if name:
315+
name = json.loads(name)
316+
if status:
317+
status = json.loads(status)
318+
if elementType:
319+
elementType = json.loads(elementType)
320+
if statusType:
321+
statusType = json.loads(statusType)
322+
if tokenOwner:
323+
tokenOwner = json.loads(tokenOwner)
324+
315325
elementStatuses = PublisherClient().getElementStatuses(
316326
self.ELEMENT_TYPE,
317327
name,

0 commit comments

Comments
 (0)