diff --git a/src/DIRAC/ProductionSystem/scripts/dirac_prod_get.py b/src/DIRAC/ProductionSystem/scripts/dirac_prod_get.py index 90426ee2d02..f7c42efdf60 100755 --- a/src/DIRAC/ProductionSystem/scripts/dirac_prod_get.py +++ b/src/DIRAC/ProductionSystem/scripts/dirac_prod_get.py @@ -24,7 +24,7 @@ def main(): prodID = args[0] res = prodClient.getProduction(prodID) - fields = ["ProductionName", "Status", "ProductionID", "CreationDate", "LastUpdate", "AuthorDN", "AuthorGroup"] + fields = ["ProductionName", "Status", "ProductionID", "CreationDate", "LastUpdate", "Author", "AuthorGroup"] records = [] if res["OK"]: @@ -39,7 +39,7 @@ def main(): str(prod["ProductionID"]), str(prod["CreationDate"]), str(prod["LastUpdate"]), - str(prod["AuthorDN"]), + str(prod["Author"]), str(prod["AuthorGroup"]), ] ) diff --git a/src/DIRAC/ProductionSystem/scripts/dirac_prod_get_all.py b/src/DIRAC/ProductionSystem/scripts/dirac_prod_get_all.py index 171f332b6ae..1c77ef3c407 100755 --- a/src/DIRAC/ProductionSystem/scripts/dirac_prod_get_all.py +++ b/src/DIRAC/ProductionSystem/scripts/dirac_prod_get_all.py @@ -16,7 +16,7 @@ def main(): prodClient = ProductionClient() res = prodClient.getProductions() - fields = ["ProductionName", "Status", "ProductionID", "CreationDate", "LastUpdate", "AuthorDN", "AuthorGroup"] + fields = ["ProductionName", "Status", "ProductionID", "CreationDate", "LastUpdate", "Author", "AuthorGroup"] records = [] if res["OK"]: @@ -31,7 +31,7 @@ def main(): str(prod["ProductionID"]), str(prod["CreationDate"]), str(prod["LastUpdate"]), - str(prod["AuthorDN"]), + str(prod["Author"]), str(prod["AuthorGroup"]), ] ) diff --git a/src/DIRAC/WorkloadManagementSystem/DB/SandboxMetadataDB.py b/src/DIRAC/WorkloadManagementSystem/DB/SandboxMetadataDB.py index 639beb8afeb..04d43dbcc39 100644 --- a/src/DIRAC/WorkloadManagementSystem/DB/SandboxMetadataDB.py +++ b/src/DIRAC/WorkloadManagementSystem/DB/SandboxMetadataDB.py @@ -330,7 +330,7 @@ def deleteSandboxes(self, SBIdList): return result return S_OK() - def getSandboxId(self, SEName, SEPFN, requesterName, requesterGroup, field="SBId", requesterDN=None): + def getSandboxId(self, SEName, SEPFN, requesterName, requesterGroup, field="SBId"): """ Get the sandboxId if it exists @@ -350,7 +350,7 @@ def getSandboxId(self, SEName, SEPFN, requesterName, requesterGroup, field="SBId "s.OwnerId=o.OwnerId", ] sqlCmd = f"SELECT s.{field} FROM `sb_SandBoxes` s, `sb_Owners` o WHERE" - requesterProps = Registry.getPropertiesForEntity(requesterGroup, name=requesterName, dn=requesterDN) + requesterProps = Registry.getPropertiesForEntity(requesterGroup, name=requesterName) if Properties.JOB_ADMINISTRATOR in requesterProps or Properties.JOB_MONITOR in requesterProps: # Do nothing, just ensure it doesn't fit in the other cases pass @@ -370,24 +370,3 @@ def getSandboxId(self, SEName, SEPFN, requesterName, requesterGroup, field="SBId if not data: return S_ERROR("No sandbox matches the requirements") return S_OK(data[0][0]) - - def getSandboxOwner(self, SEName, SEPFN, requesterDN, requesterGroup): - """get the sandbox owner, if such sandbox exists - - :param SEName: name of the StorageElement - :param SEPFN: PFN of the Sandbox - :param requesterDN: host DN used as credentials - :param requesterGroup: group used to use as credentials (should be 'hosts') - - :returns: S_OK with tuple (owner, ownerGroup, VO) - """ - if not (res := self.getSandboxId(SEName, SEPFN, None, requesterGroup, "OwnerId", requesterDN=requesterDN))[ - "OK" - ]: - return res - - if not ( - res := self._query(f"SELECT `Owner`, `OwnerGroup`, `VO` FROM `sb_Owners` WHERE `OwnerId` = {res['Value']}") - )["OK"]: - return res - return S_OK(res["Value"][0]) diff --git a/src/DIRAC/WorkloadManagementSystem/scripts/dirac_wms_pilot_job_info.py b/src/DIRAC/WorkloadManagementSystem/scripts/dirac_wms_pilot_job_info.py index 240a979307b..87519103fb7 100755 --- a/src/DIRAC/WorkloadManagementSystem/scripts/dirac_wms_pilot_job_info.py +++ b/src/DIRAC/WorkloadManagementSystem/scripts/dirac_wms_pilot_job_info.py @@ -19,7 +19,7 @@ def _stringInList(subStr, sList): @Script() def main(): - parameters = ["OwnerDN", "StartExecTime", "EndExecTime"] + parameters = ["Owner", "StartExecTime", "EndExecTime"] Script.registerSwitch("", "Parameters=", " List of strings to be matched by job parameters or attributes") # Registering arguments will automatically add their description to the help menu Script.registerArgument(["PilotID: Grid ID of the pilot"]) diff --git a/tests/Integration/WorkloadManagementSystem/Test_SandboxMetadataDB.py b/tests/Integration/WorkloadManagementSystem/Test_SandboxMetadataDB.py index 6da5c5303f7..8208bf5c4eb 100644 --- a/tests/Integration/WorkloadManagementSystem/Test_SandboxMetadataDB.py +++ b/tests/Integration/WorkloadManagementSystem/Test_SandboxMetadataDB.py @@ -15,7 +15,6 @@ def test_SandboxMetadataDB(): smDB = SandboxMetadataDB() owner = "adminusername" - ownerDN = "/C=ch/O=DIRAC/OU=DIRAC CI/CN=ciuser" ownerGroup = "dirac_admin" VO = "vo" @@ -33,10 +32,6 @@ def test_SandboxMetadataDB(): assert res["OK"], res["Message"] assert res["Value"] == 1 - res = smDB.getSandboxOwner(sbSE, sbPFN, ownerDN, ownerGroup) - assert res["OK"], res["Message"] - assert res["Value"] == (owner, ownerGroup, VO) - res = smDB.getSandboxId(sbSE, sbPFN, owner, ownerGroup) assert res["OK"], res["Message"] assert res["Value"] == sbId