@@ -283,26 +283,30 @@ def _executeClean(self, transDict):
283
283
res = self .archiveTransformation (transDict ["TransformationID" ])
284
284
if not res ["OK" ]:
285
285
self .log .error (
286
- "Problems archiving transformation %s: %s" % (transDict ["TransformationID" ], res ["Message" ])
286
+ "Problems archiving transformation" , " %s: %s" % (transDict ["TransformationID" ], res ["Message" ])
287
287
)
288
288
else :
289
289
res = self .cleanTransformation (transDict ["TransformationID" ])
290
290
if not res ["OK" ]:
291
291
self .log .error (
292
- "Problems cleaning transformation %s: %s" % (transDict ["TransformationID" ], res ["Message" ])
292
+ "Problems cleaning transformation" , " %s: %s" % (transDict ["TransformationID" ], res ["Message" ])
293
293
)
294
294
295
295
def _executeRemoval (self , transDict ):
296
296
"""Remove files from given transformation."""
297
297
res = self .removeTransformationOutput (transDict ["TransformationID" ])
298
298
if not res ["OK" ]:
299
- self .log .error ("Problems removing transformation %s: %s" % (transDict ["TransformationID" ], res ["Message" ]))
299
+ self .log .error (
300
+ "Problems removing transformation" , "%s: %s" % (transDict ["TransformationID" ], res ["Message" ])
301
+ )
300
302
301
303
def _executeArchive (self , transDict ):
302
304
"""Archive the given transformation."""
303
305
res = self .archiveTransformation (transDict ["TransformationID" ])
304
306
if not res ["OK" ]:
305
- self .log .error ("Problems archiving transformation %s: %s" % (transDict ["TransformationID" ], res ["Message" ]))
307
+ self .log .error (
308
+ "Problems archiving transformation" , "%s: %s" % (transDict ["TransformationID" ], res ["Message" ])
309
+ )
306
310
307
311
return S_OK ()
308
312
@@ -385,7 +389,7 @@ def cleanContent(self, directory):
385
389
if not filesFound :
386
390
self .log .info ("No files are registered in the catalog directory %s" % directory )
387
391
return S_OK ()
388
- self .log .info ("Attempting to remove %d possible remnants from the catalog and storage" % len (filesFound ))
392
+ self .log .info ("Attempting to remove possible remnants from the catalog and storage" , "(n=%d) " % len (filesFound ))
389
393
390
394
# Executing with shifter proxy
391
395
gConfigurationData .setOptionInCFG ("/DIRAC/Security/UseServerCertificate" , "false" )
@@ -427,12 +431,12 @@ def __getCatalogDirectoryContents(self, directories):
427
431
if "No such file or directory" in res ["Message" ]:
428
432
self .log .info ("%s: %s" % (currentDir , res ["Message" ]))
429
433
else :
430
- self .log .error ("Failed to get directory %s content: %s " % ( currentDir , res ["Message" ]) )
434
+ self .log .error ("Failed to get directory %s content" % currentDir , res ["Message" ])
431
435
else :
432
436
dirContents = res ["Value" ]
433
437
activeDirs .extend (dirContents ["SubDirs" ])
434
438
allFiles .update (dirContents ["Files" ])
435
- self .log .info ("Found %d files" % len (allFiles ))
439
+ self .log .info ("" , " Found %d files" % len (allFiles ))
436
440
return S_OK (list (allFiles ))
437
441
438
442
def cleanTransformationLogFiles (self , directory ):
@@ -441,7 +445,7 @@ def cleanTransformationLogFiles(self, directory):
441
445
:param self: self reference
442
446
:param str directory: folder name
443
447
"""
444
- self .log .verbose ("Removing log files found in the directory %s" % directory )
448
+ self .log .verbose ("Removing log files found in the directory" , directory )
445
449
res = returnSingleResult (StorageElement (self .logSE ).removeDirectory (directory , recursive = True ))
446
450
if not res ["OK" ]:
447
451
if cmpError (res , errno .ENOENT ): # No such file or directory
@@ -462,7 +466,7 @@ def removeTransformationOutput(self, transID):
462
466
self .log .info ("Removing output data for transformation %s" % transID )
463
467
res = self .getTransformationDirectories (transID )
464
468
if not res ["OK" ]:
465
- self .log .error (' Problem obtaining directories for transformation %s with result "%s"' % (transID , res ))
469
+ self .log .error (" Problem obtaining directories for transformation" , " %s with result '%s'" % (transID , res ))
466
470
return S_OK ()
467
471
directories = res ["Value" ]
468
472
for directory in directories :
@@ -480,7 +484,7 @@ def removeTransformationOutput(self, transID):
480
484
res = self .cleanMetadataCatalogFiles (transID )
481
485
if not res ["OK" ]:
482
486
return res
483
- self .log .info ("Successfully removed output of transformation %d" % transID )
487
+ self .log .info ("Successfully removed output of transformation" , transID )
484
488
# Change the status of the transformation to RemovedFiles
485
489
res = self .transClient .setTransformationParameter (transID , "Status" , "RemovedFiles" )
486
490
if not res ["OK" ]:
@@ -517,10 +521,12 @@ def cleanTransformation(self, transID):
517
521
"""This removes what was produced by the supplied transformation,
518
522
leaving only some info and log in the transformation DB.
519
523
"""
520
- self .log .info ("Cleaning transformation %s" % transID )
524
+ self .log .info ("Cleaning transformation" , transID )
521
525
res = self .getTransformationDirectories (transID )
522
526
if not res ["OK" ]:
523
- self .log .error ('Problem obtaining directories for transformation %s with result "%s"' % (transID , res ))
527
+ self .log .error (
528
+ "Problem obtaining directories for transformation" , "%s with result '%s'" % (transID , res ["Message" ])
529
+ )
524
530
return S_OK ()
525
531
directories = res ["Value" ]
526
532
# Clean the jobs in the WMS and any failover requests found
@@ -545,12 +551,12 @@ def cleanTransformation(self, transID):
545
551
res = self .transClient .cleanTransformation (transID )
546
552
if not res ["OK" ]:
547
553
return res
548
- self .log .info ("Successfully cleaned transformation %d" % transID )
554
+ self .log .info ("Successfully cleaned transformation" , transID )
549
555
res = self .transClient .setTransformationParameter (transID , "Status" , "Cleaned" )
550
556
if not res ["OK" ]:
551
557
self .log .error ("Failed to update status of transformation %s to Cleaned" % (transID ), res ["Message" ])
552
558
return res
553
- self .log .info ("Updated status of transformation %s to Cleaned" % (transID ))
559
+ self .log .info ("Updated status of transformation" , " %s to Cleaned" % (transID ))
554
560
return S_OK ()
555
561
556
562
def cleanMetadataCatalogFiles (self , transID ):
@@ -560,7 +566,7 @@ def cleanMetadataCatalogFiles(self, transID):
560
566
return res
561
567
fileToRemove = res ["Value" ]
562
568
if not fileToRemove :
563
- self .log .info ("No files found for transID %s" % transID )
569
+ self .log .info ("No files found for transID" , transID )
564
570
return S_OK ()
565
571
566
572
# Executing with shifter proxy
@@ -574,7 +580,7 @@ def cleanMetadataCatalogFiles(self, transID):
574
580
self .log .error ("Failed to remove file found in metadata catalog" , "%s %s" % (lfn , reason ))
575
581
if res ["Value" ]["Failed" ]:
576
582
return S_ERROR ("Failed to remove all files found in the metadata catalog" )
577
- self .log .info ("Successfully removed all files found in the BK " )
583
+ self .log .info ("Successfully removed all files found in the DFC " )
578
584
return S_OK ()
579
585
580
586
#############################################################################
@@ -584,7 +590,7 @@ def cleanMetadataCatalogFiles(self, transID):
584
590
585
591
def cleanTransformationTasks (self , transID ):
586
592
"""clean tasks from WMS, or from the RMS if it is a DataManipulation transformation"""
587
- self .log .verbose ("Cleaning Transformation tasks of transformation %d" % transID )
593
+ self .log .verbose ("Cleaning Transformation tasks of transformation" , transID )
588
594
res = self .__getTransformationExternalIDs (transID )
589
595
if not res ["OK" ]:
590
596
return res
@@ -640,24 +646,26 @@ def __removeWMSTasks(self, transJobIDs):
640
646
if res ["OK" ]:
641
647
self .log .info ("Successfully killed %d jobs from WMS" % len (jobList ))
642
648
elif ("InvalidJobIDs" in res ) and ("NonauthorizedJobIDs" not in res ) and ("FailedJobIDs" not in res ):
643
- self .log .info ("Found %s jobs which did not exist in the WMS" % len (res ["InvalidJobIDs" ]))
649
+ self .log .info ("Found jobs which did not exist in the WMS" , "(n=%d) " % len (res ["InvalidJobIDs" ]))
644
650
elif "NonauthorizedJobIDs" in res :
645
- self .log .error ("Failed to kill %s jobs because not authorized" % len (res ["NonauthorizedJobIDs" ]))
651
+ self .log .error ("Failed to kill jobs because not authorized" , "(n=%d) " % len (res ["NonauthorizedJobIDs" ]))
646
652
allRemove = False
647
653
elif "FailedJobIDs" in res :
648
- self .log .error ("Failed to kill %s jobs" % len (res ["FailedJobIDs" ]))
654
+ self .log .error ("Failed to kill jobs" , "(n=%d) " % len (res ["FailedJobIDs" ]))
649
655
allRemove = False
650
656
651
- res = self .wmsClient .deleteJob (jobList )
657
+ res = self .wmsClient .removeJob (jobList )
652
658
if res ["OK" ]:
653
- self .log .info ("Successfully removed %d jobs from WMS" % len (jobList ))
659
+ self .log .info ("Successfully removed jobs from WMS" , "(n=%d) " % len (jobList ))
654
660
elif ("InvalidJobIDs" in res ) and ("NonauthorizedJobIDs" not in res ) and ("FailedJobIDs" not in res ):
655
- self .log .info ("Found %s jobs which did not exist in the WMS" % len (res ["InvalidJobIDs" ]))
661
+ self .log .info ("Found jobs which did not exist in the WMS" , "(n=%d) " % len (res ["InvalidJobIDs" ]))
656
662
elif "NonauthorizedJobIDs" in res :
657
- self .log .error ("Failed to remove %s jobs because not authorized" % len (res ["NonauthorizedJobIDs" ]))
663
+ self .log .error (
664
+ "Failed to remove jobs because not authorized" , "(n=%d)" % len (res ["NonauthorizedJobIDs" ])
665
+ )
658
666
allRemove = False
659
667
elif "FailedJobIDs" in res :
660
- self .log .error ("Failed to remove %s jobs" % len (res ["FailedJobIDs" ]))
668
+ self .log .error ("Failed to remove jobs" , "(n=%d) " % len (res ["FailedJobIDs" ]))
661
669
allRemove = False
662
670
663
671
if not allRemove :
@@ -689,8 +697,8 @@ def __removeWMSTasks(self, transJobIDs):
689
697
self .log .verbose ("Removed request %s associated to job %d." % (requestID , jobID ))
690
698
691
699
if failed :
692
- self .log .info ("Successfully removed %s requests" % (len (failoverRequests ) - failed ))
693
- self .log .info ("Failed to remove %s requests" % failed )
700
+ self .log .info ("Successfully removed requests" , "(n=%d) " % (len (failoverRequests ) - failed ))
701
+ self .log .info ("Failed to remove requests" , "(n=%d) " % failed )
694
702
return S_ERROR ("Failed to remove all the request from RequestDB" )
695
703
self .log .info ("Successfully removed all the associated failover requests" )
696
704
return S_OK ()
0 commit comments