Skip to content

Commit 3b20343

Browse files
fix: Fixed ClientSelector to raise an error if the CS is badly configured
1 parent 4b715ef commit 3b20343

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

integration_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
# All services that have a FutureClient, but we *explicitly* deactivate
4444
# (for example if we did not finish to develop it)
4545
DIRACX_DISABLED_SERVICES = [
46-
# "WorkloadManagement/JobMonitoring",
46+
"WorkloadManagement/JobMonitoring",
4747
]
4848

4949
# Static configuration

src/DIRAC/Core/Tornado/Client/ClientSelector.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ def ClientSelector(disetClient, *args, **kwargs): # We use same interface as RP
8181
rpc = tornadoClient(*args, **kwargs)
8282
else:
8383
rpc = disetClient(*args, **kwargs)
84+
except NotImplementedError as e:
85+
# We catch explicitly NotImplementedError to avoid just printing "there's an error"
86+
# If we mis-configured the CS for legacy adapted services, we MUST have an error.
87+
raise e
8488
except Exception as e: # pylint: disable=broad-except
8589
# If anything went wrong in the resolution, we return default RPCClient
8690
# So the behaviour is exactly the same as before implementation of Tornado

src/DIRAC/WorkloadManagementSystem/Client/JobMonitoringClient.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
@createClient("WorkloadManagement/JobMonitoring")
1616
class JobMonitoringClient(Client):
17+
# Set to None to raise an error if this service is set as "legacy adapted"
18+
# See ClientSelector
1719
diracxClient = None
1820

1921
def __init__(self, **kwargs):

0 commit comments

Comments
 (0)