Skip to content

Commit eff751a

Browse files
committed
fix: removed premature backports from 8.1
1 parent 49edfa6 commit eff751a

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

src/DIRAC/WorkloadManagementSystem/Service/SandboxStoreHandler.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -358,39 +358,47 @@ def __copyToExternalSE(self, localFilePath, sbPath):
358358

359359
types_assignSandboxesToEntities = [dict]
360360

361-
def export_assignSandboxesToEntities(self, enDict, ownerName="", ownerGroup=""):
361+
def export_assignSandboxesToEntities(self, enDict, ownerName="", ownerGroup="", entitySetup=False):
362362
"""
363363
Assign sandboxes to jobs.
364364
Expects a dict of { entityId : [ ( SB, SBType ), ... ] }
365365
"""
366+
if not entitySetup:
367+
entitySetup = self.serviceInfoDict["clientSetup"]
366368
credDict = self.getRemoteCredentials()
367369
return self.sandboxDB.assignSandboxesToEntities(
368-
enDict, credDict["username"], credDict["group"], ownerName, ownerGroup
370+
enDict, credDict["username"], credDict["group"], entitySetup, ownerName, ownerGroup
369371
)
370372

371373
##################
372374
# Unassign sbs to jobs
373375

374376
types_unassignEntities = [(list, tuple)]
375377

376-
def export_unassignEntities(self, entitiesList):
378+
def export_unassignEntities(self, entitiesList, entitiesSetup=False):
377379
"""
378380
Unassign a list of jobs
379381
"""
382+
if not entitiesSetup:
383+
entitiesSetup = self.serviceInfoDict["clientSetup"]
380384
credDict = self.getRemoteCredentials()
381-
return self.sandboxDB.unassignEntities(entitiesList, credDict["username"], credDict["group"])
385+
return self.sandboxDB.unassignEntities({entitiesSetup: entitiesList}, credDict["username"], credDict["group"])
382386

383387
##################
384388
# Getting assigned sandboxes
385389

386390
types_getSandboxesAssignedToEntity = [str]
387391

388-
def export_getSandboxesAssignedToEntity(self, entityId):
392+
def export_getSandboxesAssignedToEntity(self, entityId, entitySetup=False):
389393
"""
390394
Get the sandboxes associated to a job and the association type
391395
"""
396+
if not entitySetup:
397+
entitySetup = self.serviceInfoDict["clientSetup"]
392398
credDict = self.getRemoteCredentials()
393-
result = self.sandboxDB.getSandboxesAssignedToEntity(entityId, credDict["username"], credDict["group"])
399+
result = self.sandboxDB.getSandboxesAssignedToEntity(
400+
entityId, entitySetup, credDict["username"], credDict["group"]
401+
)
394402
if not result["OK"]:
395403
return result
396404
sbDict = {}

0 commit comments

Comments
 (0)