Skip to content

Commit f8cc981

Browse files
committed
fix: removed unused RPCs
1 parent 7291fc5 commit f8cc981

File tree

4 files changed

+0
-68
lines changed

4 files changed

+0
-68
lines changed

src/DIRAC/WorkloadManagementSystem/FutureClient/JobStateUpdateClient.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,6 @@ def setJobAttribute(self, jobID: str | int, attribute: str, value: str):
8383
else:
8484
return api.jobs.patch_metadata({jobID: {attribute: value}})
8585

86-
@stripValueIfOK
87-
@convertToReturnValue
88-
def setJobFlag(self, jobID: str | int, flag: str):
89-
with DiracXClient() as api:
90-
api.jobs.patch_metadata({jobID: {flag: True}})
91-
9286
@stripValueIfOK
9387
@convertToReturnValue
9488
def setJobParameter(self, jobID: str | int, name: str, value: str):
@@ -151,12 +145,6 @@ def setJobsParameter(self, jobsParameterDict: dict):
151145
updates = {job_id: {k: v} for job_id, (k, v) in jobsParameterDict.items()}
152146
api.jobs.patch_metadata(updates)
153147

154-
@stripValueIfOK
155-
@convertToReturnValue
156-
def unsetJobFlag(self, jobID: str | int, flag: str):
157-
with DiracXClient() as api:
158-
api.jobs.patch_metadata({jobID: {flag: False}})
159-
160148
@stripValueIfOK
161149
@convertToReturnValue
162150
def updateJobFromStager(self, jobID: str | int, status: str):

src/DIRAC/WorkloadManagementSystem/Service/JobStateUpdateHandler.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -128,22 +128,6 @@ def export_setJobSite(cls, jobID, site):
128128
"""Allows the site attribute to be set for a job specified by its jobID."""
129129
return cls.jobDB.setJobAttribute(int(jobID), "Site", site)
130130

131-
###########################################################################
132-
types_setJobFlag = [[str, int], str]
133-
134-
@classmethod
135-
def export_setJobFlag(cls, jobID, flag):
136-
"""Set job flag for job with jobID"""
137-
return cls.jobDB.setJobAttribute(int(jobID), flag, "True")
138-
139-
###########################################################################
140-
types_unsetJobFlag = [[str, int], str]
141-
142-
@classmethod
143-
def export_unsetJobFlag(cls, jobID, flag):
144-
"""Unset job flag for job with jobID"""
145-
return cls.jobDB.setJobAttribute(int(jobID), flag, "False")
146-
147131
###########################################################################
148132
types_setJobApplicationStatus = [[str, int], str, str]
149133

tests/Integration/FutureClient/WorkloadManagement/Test_JobStateUpdate.py

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -142,42 +142,6 @@ def test_setJobAttribute(monkeypatch, example_jobids, args):
142142
assert result[example_jobids[0]] == result[example_jobids[1]]
143143

144144

145-
def test_setJobFlag(monkeypatch, example_jobids):
146-
# JobStateUpdateClient().setJobFlag(jobID: str | int, flag: str)
147-
assert returnValueOrRaise(JobMonitoringClient().getJobAttribute(example_jobids[0], "AccountedFlag")) == "False"
148-
assert returnValueOrRaise(JobMonitoringClient().getJobAttribute(example_jobids[1], "AccountedFlag")) == "False"
149-
150-
method = JobStateUpdateClient().setJobFlag
151-
test_func1 = partial(method, example_jobids[0], "AccountedFlag")
152-
test_func2 = partial(method, example_jobids[1], "AccountedFlag")
153-
compare_results2(monkeypatch, test_func1, test_func2)
154-
155-
assert returnValueOrRaise(JobMonitoringClient().getJobAttribute(example_jobids[0], "AccountedFlag")) == "True"
156-
assert returnValueOrRaise(JobMonitoringClient().getJobAttribute(example_jobids[1], "AccountedFlag")) == "True"
157-
158-
159-
def test_unsetJobFlag(monkeypatch, example_jobids):
160-
# JobStateUpdateClient().unsetJobFlag(jobID: str | int, flag: str)
161-
assert returnValueOrRaise(JobMonitoringClient().getJobAttribute(example_jobids[0], "AccountedFlag")) == "False"
162-
assert returnValueOrRaise(JobMonitoringClient().getJobAttribute(example_jobids[1], "AccountedFlag")) == "False"
163-
164-
method = JobStateUpdateClient().setJobFlag
165-
test_func1 = partial(method, example_jobids[0], "AccountedFlag")
166-
test_func2 = partial(method, example_jobids[1], "AccountedFlag")
167-
compare_results2(monkeypatch, test_func1, test_func2)
168-
169-
assert returnValueOrRaise(JobMonitoringClient().getJobAttribute(example_jobids[0], "AccountedFlag")) == "True"
170-
assert returnValueOrRaise(JobMonitoringClient().getJobAttribute(example_jobids[1], "AccountedFlag")) == "True"
171-
172-
method = JobStateUpdateClient().unsetJobFlag
173-
test_func1 = partial(method, example_jobids[0], "AccountedFlag")
174-
test_func2 = partial(method, example_jobids[1], "AccountedFlag")
175-
compare_results2(monkeypatch, test_func1, test_func2)
176-
177-
assert returnValueOrRaise(JobMonitoringClient().getJobAttribute(example_jobids[0], "AccountedFlag")) == "False"
178-
assert returnValueOrRaise(JobMonitoringClient().getJobAttribute(example_jobids[1], "AccountedFlag")) == "False"
179-
180-
181145
@pytest.mark.parametrize(
182146
"args",
183147
[

tests/Integration/WorkloadManagementSystem/Test_Client_WMS.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -293,10 +293,6 @@ def test_JobStateUpdateAndJobMonitoring() -> None:
293293
assert res["OK"], res["Message"]
294294
res = jobStateUpdateClient.setJobApplicationStatus(jobID, "app status", "source")
295295
assert res["OK"], res["Message"]
296-
# res = jobStateUpdate.setJobFlag()
297-
# self.assertTrue(res['OK'], res.get('Message'))
298-
# res = jobStateUpdate.unsetJobFlag()
299-
# self.assertTrue(res['OK'], res.get('Message'))
300296
res = jobStateUpdateClient.setJobSite(jobID, "Site")
301297
assert res["OK"], res["Message"]
302298

0 commit comments

Comments
 (0)