18
18
from DIRAC .Core .Utilities .List import breakListIntoChunks
19
19
from DIRAC .Core .Utilities .Dictionaries import breakDictionaryIntoChunks
20
20
from DIRAC .ConfigurationSystem .Client .Helpers .Operations import Operations
21
- from DIRAC .ConfigurationSystem .Client .Helpers .Registry import getDNForUsername , getUsernameForDN
22
21
from DIRAC .TransformationSystem .Client .FileReport import FileReport
23
22
from DIRAC .TransformationSystem .Client .WorkflowTasks import WorkflowTasks
24
23
from DIRAC .TransformationSystem .Client .TransformationClient import TransformationClient
@@ -249,21 +248,21 @@ def _selectTransformations(self, transType=None, status=None, agentType=None):
249
248
250
249
#############################################################################
251
250
252
- def _getClients (self , ownerDN = None , ownerGroup = None ):
251
+ def _getClients (self , owner = None , ownerGroup = None ):
253
252
"""Returns the clients used in the threads
254
253
255
254
This is another function that should be extended.
256
255
257
256
The clients provided here are defaults, and should be adapted
258
257
259
- If ownerDN and ownerGroup are not None the clients will delegate to these credentials
258
+ If owner and ownerGroup are not None the clients will delegate to these credentials
260
259
261
- :param str ownerDN: DN of the owner of the submitted jobs
260
+ :param str owner: owner of the submitted jobs
262
261
:param str ownerGroup: group of the owner of the submitted jobs
263
262
:returns: dict of Clients
264
263
"""
265
264
threadTransformationClient = TransformationClient ()
266
- threadTaskManager = WorkflowTasks (ownerDN = ownerDN , ownerGroup = ownerGroup )
265
+ threadTaskManager = WorkflowTasks (owner = owner , ownerGroup = ownerGroup )
267
266
threadTaskManager .pluginLocation = self .pluginLocation
268
267
269
268
return {"TransformationClient" : threadTransformationClient , "TaskManager" : threadTaskManager }
@@ -274,7 +273,7 @@ def _execute(self, transDict):
274
273
clients = (
275
274
self ._getClients ()
276
275
if self .shifterProxy
277
- else self ._getClients (ownerGroup = self .credTuple [1 ], ownerDN = self .credTuple [2 ])
276
+ else self ._getClients (owner = self .credTuple [0 ], ownerGroup = self .credTuple [1 ])
278
277
if self .credentials
279
278
else None
280
279
)
@@ -288,8 +287,8 @@ def _execute(self, transDict):
288
287
transID = transDict ["TransformationID" ]
289
288
operations = transDict ["Operations" ]
290
289
if not (self .credentials or self .shifterProxy ):
291
- ownerDN , group = transDict ["OwnerDN " ], transDict ["OwnerGroup" ]
292
- clients = self ._getClients (ownerDN = ownerDN , ownerGroup = group )
290
+ owner , group = transDict ["Owner " ], transDict ["OwnerGroup" ]
291
+ clients = self ._getClients (owner = owner , ownerGroup = group )
293
292
self ._logInfo ("Start processing transformation" , method = method , transID = transID )
294
293
for operation in operations :
295
294
self ._logInfo (f"Executing { operation } " , method = method , transID = transID )
@@ -651,30 +650,28 @@ def _addOperationForTransformations(
651
650
transformations ,
652
651
owner = None ,
653
652
ownerGroup = None ,
654
- ownerDN = None ,
655
653
):
656
654
"""Fill the operationsOnTransformationDict"""
657
655
658
656
transformationIDsAndBodies = (
659
657
(
660
658
transformation ["TransformationID" ],
661
659
transformation ["Body" ],
662
- transformation ["AuthorDN " ],
660
+ transformation ["Author " ],
663
661
transformation ["AuthorGroup" ],
664
662
)
665
663
for transformation in transformations ["Value" ]
666
664
)
667
- for transID , body , t_ownerDN , t_ownerGroup in transformationIDsAndBodies :
665
+ for transID , body , t_owner , t_ownerGroup in transformationIDsAndBodies :
668
666
if transID in operationsOnTransformationDict :
669
667
operationsOnTransformationDict [transID ]["Operations" ].append (operation )
670
668
else :
671
669
operationsOnTransformationDict [transID ] = {
672
670
"TransformationID" : transID ,
673
671
"Body" : body ,
674
672
"Operations" : [operation ],
675
- "Owner" : owner if owner else getUsernameForDN ( t_ownerDN )[ "Value" ] ,
673
+ "Owner" : owner if owner else t_owner ,
676
674
"OwnerGroup" : ownerGroup if owner else t_ownerGroup ,
677
- "OwnerDN" : ownerDN if owner else t_ownerDN ,
678
675
}
679
676
680
677
def __getCredentials (self ):
@@ -691,7 +688,6 @@ def __getCredentials(self):
691
688
owner = resCred ["Value" ]["User" ]
692
689
ownerGroup = resCred ["Value" ]["Group" ]
693
690
# returns a list
694
- ownerDN = getDNForUsername (owner )["Value" ][0 ]
695
- self .credTuple = (owner , ownerGroup , ownerDN )
691
+ self .credTuple = (owner , ownerGroup )
696
692
self .log .info (f"Cred: Tasks will be submitted with the credentials { owner } :{ ownerGroup } " )
697
693
return S_OK ()
0 commit comments