Skip to content

Commit 2b4e76e

Browse files
authored
Merge pull request #8148 from fstagni/90_removeSomeDNs
[9.0] fix: removal of few DNs
2 parents 3eb3e70 + 3af2b9a commit 2b4e76e

File tree

5 files changed

+7
-33
lines changed

5 files changed

+7
-33
lines changed

src/DIRAC/ProductionSystem/scripts/dirac_prod_get.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def main():
2424
prodID = args[0]
2525
res = prodClient.getProduction(prodID)
2626

27-
fields = ["ProductionName", "Status", "ProductionID", "CreationDate", "LastUpdate", "AuthorDN", "AuthorGroup"]
27+
fields = ["ProductionName", "Status", "ProductionID", "CreationDate", "LastUpdate", "Author", "AuthorGroup"]
2828
records = []
2929

3030
if res["OK"]:
@@ -39,7 +39,7 @@ def main():
3939
str(prod["ProductionID"]),
4040
str(prod["CreationDate"]),
4141
str(prod["LastUpdate"]),
42-
str(prod["AuthorDN"]),
42+
str(prod["Author"]),
4343
str(prod["AuthorGroup"]),
4444
]
4545
)

src/DIRAC/ProductionSystem/scripts/dirac_prod_get_all.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def main():
1616
prodClient = ProductionClient()
1717
res = prodClient.getProductions()
1818

19-
fields = ["ProductionName", "Status", "ProductionID", "CreationDate", "LastUpdate", "AuthorDN", "AuthorGroup"]
19+
fields = ["ProductionName", "Status", "ProductionID", "CreationDate", "LastUpdate", "Author", "AuthorGroup"]
2020
records = []
2121

2222
if res["OK"]:
@@ -31,7 +31,7 @@ def main():
3131
str(prod["ProductionID"]),
3232
str(prod["CreationDate"]),
3333
str(prod["LastUpdate"]),
34-
str(prod["AuthorDN"]),
34+
str(prod["Author"]),
3535
str(prod["AuthorGroup"]),
3636
]
3737
)

src/DIRAC/WorkloadManagementSystem/DB/SandboxMetadataDB.py

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ def deleteSandboxes(self, SBIdList):
330330
return result
331331
return S_OK()
332332

333-
def getSandboxId(self, SEName, SEPFN, requesterName, requesterGroup, field="SBId", requesterDN=None):
333+
def getSandboxId(self, SEName, SEPFN, requesterName, requesterGroup, field="SBId"):
334334
"""
335335
Get the sandboxId if it exists
336336
@@ -350,7 +350,7 @@ def getSandboxId(self, SEName, SEPFN, requesterName, requesterGroup, field="SBId
350350
"s.OwnerId=o.OwnerId",
351351
]
352352
sqlCmd = f"SELECT s.{field} FROM `sb_SandBoxes` s, `sb_Owners` o WHERE"
353-
requesterProps = Registry.getPropertiesForEntity(requesterGroup, name=requesterName, dn=requesterDN)
353+
requesterProps = Registry.getPropertiesForEntity(requesterGroup, name=requesterName)
354354
if Properties.JOB_ADMINISTRATOR in requesterProps or Properties.JOB_MONITOR in requesterProps:
355355
# Do nothing, just ensure it doesn't fit in the other cases
356356
pass
@@ -370,24 +370,3 @@ def getSandboxId(self, SEName, SEPFN, requesterName, requesterGroup, field="SBId
370370
if not data:
371371
return S_ERROR("No sandbox matches the requirements")
372372
return S_OK(data[0][0])
373-
374-
def getSandboxOwner(self, SEName, SEPFN, requesterDN, requesterGroup):
375-
"""get the sandbox owner, if such sandbox exists
376-
377-
:param SEName: name of the StorageElement
378-
:param SEPFN: PFN of the Sandbox
379-
:param requesterDN: host DN used as credentials
380-
:param requesterGroup: group used to use as credentials (should be 'hosts')
381-
382-
:returns: S_OK with tuple (owner, ownerGroup, VO)
383-
"""
384-
if not (res := self.getSandboxId(SEName, SEPFN, None, requesterGroup, "OwnerId", requesterDN=requesterDN))[
385-
"OK"
386-
]:
387-
return res
388-
389-
if not (
390-
res := self._query(f"SELECT `Owner`, `OwnerGroup`, `VO` FROM `sb_Owners` WHERE `OwnerId` = {res['Value']}")
391-
)["OK"]:
392-
return res
393-
return S_OK(res["Value"][0])

src/DIRAC/WorkloadManagementSystem/scripts/dirac_wms_pilot_job_info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def _stringInList(subStr, sList):
1919

2020
@Script()
2121
def main():
22-
parameters = ["OwnerDN", "StartExecTime", "EndExecTime"]
22+
parameters = ["Owner", "StartExecTime", "EndExecTime"]
2323
Script.registerSwitch("", "Parameters=", " List of strings to be matched by job parameters or attributes")
2424
# Registering arguments will automatically add their description to the help menu
2525
Script.registerArgument(["PilotID: Grid ID of the pilot"])

tests/Integration/WorkloadManagementSystem/Test_SandboxMetadataDB.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ def test_SandboxMetadataDB():
1515
smDB = SandboxMetadataDB()
1616

1717
owner = "adminusername"
18-
ownerDN = "/C=ch/O=DIRAC/OU=DIRAC CI/CN=ciuser"
1918
ownerGroup = "dirac_admin"
2019
VO = "vo"
2120

@@ -33,10 +32,6 @@ def test_SandboxMetadataDB():
3332
assert res["OK"], res["Message"]
3433
assert res["Value"] == 1
3534

36-
res = smDB.getSandboxOwner(sbSE, sbPFN, ownerDN, ownerGroup)
37-
assert res["OK"], res["Message"]
38-
assert res["Value"] == (owner, ownerGroup, VO)
39-
4035
res = smDB.getSandboxId(sbSE, sbPFN, owner, ownerGroup)
4136
assert res["OK"], res["Message"]
4237
assert res["Value"] == sbId

0 commit comments

Comments
 (0)