@@ -358,39 +358,47 @@ def __copyToExternalSE(self, localFilePath, sbPath):
358
358
359
359
types_assignSandboxesToEntities = [dict ]
360
360
361
- def export_assignSandboxesToEntities (self , enDict , ownerName = "" , ownerGroup = "" ):
361
+ def export_assignSandboxesToEntities (self , enDict , ownerName = "" , ownerGroup = "" , entitySetup = False ):
362
362
"""
363
363
Assign sandboxes to jobs.
364
364
Expects a dict of { entityId : [ ( SB, SBType ), ... ] }
365
365
"""
366
+ if not entitySetup :
367
+ entitySetup = self .serviceInfoDict ["clientSetup" ]
366
368
credDict = self .getRemoteCredentials ()
367
369
return self .sandboxDB .assignSandboxesToEntities (
368
- enDict , credDict ["username" ], credDict ["group" ], ownerName , ownerGroup
370
+ enDict , credDict ["username" ], credDict ["group" ], entitySetup , ownerName , ownerGroup
369
371
)
370
372
371
373
##################
372
374
# Unassign sbs to jobs
373
375
374
376
types_unassignEntities = [(list , tuple )]
375
377
376
- def export_unassignEntities (self , entitiesList ):
378
+ def export_unassignEntities (self , entitiesList , entitiesSetup = False ):
377
379
"""
378
380
Unassign a list of jobs
379
381
"""
382
+ if not entitiesSetup :
383
+ entitiesSetup = self .serviceInfoDict ["clientSetup" ]
380
384
credDict = self .getRemoteCredentials ()
381
- return self .sandboxDB .unassignEntities (entitiesList , credDict ["username" ], credDict ["group" ])
385
+ return self .sandboxDB .unassignEntities ({ entitiesSetup : entitiesList } , credDict ["username" ], credDict ["group" ])
382
386
383
387
##################
384
388
# Getting assigned sandboxes
385
389
386
390
types_getSandboxesAssignedToEntity = [str ]
387
391
388
- def export_getSandboxesAssignedToEntity (self , entityId ):
392
+ def export_getSandboxesAssignedToEntity (self , entityId , entitySetup = False ):
389
393
"""
390
394
Get the sandboxes associated to a job and the association type
391
395
"""
396
+ if not entitySetup :
397
+ entitySetup = self .serviceInfoDict ["clientSetup" ]
392
398
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
+ )
394
402
if not result ["OK" ]:
395
403
return result
396
404
sbDict = {}
0 commit comments