From cce8c21c80a821535ab72fd5b7043f03713b8540 Mon Sep 17 00:00:00 2001 From: aldbr Date: Thu, 14 Sep 2023 15:26:09 +0200 Subject: [PATCH] fix: align jobMonitoringClient with the new DiracClient --- .../FutureClient/JobMonitoringClient.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/DIRAC/WorkloadManagementSystem/FutureClient/JobMonitoringClient.py b/src/DIRAC/WorkloadManagementSystem/FutureClient/JobMonitoringClient.py index 5759a8e7fed..f7ec91ac1ca 100644 --- a/src/DIRAC/WorkloadManagementSystem/FutureClient/JobMonitoringClient.py +++ b/src/DIRAC/WorkloadManagementSystem/FutureClient/JobMonitoringClient.py @@ -1,23 +1,16 @@ # pylint: disable=import-error -from diracx.client import Dirac +from diracx.client import DiracClient from diracx.client.models import JobSearchParams -from diracx.cli.utils import get_auth_headers -from diracx.core.preferences import DiracxPreferences - from DIRAC.Core.Utilities.ReturnValues import convertToReturnValue class JobMonitoringClient: - def __init__(self, *args, **kwargs): - self.endpoint = DiracxPreferences().url - def fetch(self, parameters, jobIDs): - with Dirac(endpoint=self.endpoint) as api: + with DiracClient() as api: jobs = api.jobs.search( parameters=["JobID"] + parameters, search=[{"parameter": "JobID", "operator": "in", "values": jobIDs}], - headers=get_auth_headers(), ) return {j["JobID"]: {param: j[param] for param in parameters} for j in jobs}