File tree Expand file tree Collapse file tree
Framework/script/RepoCleaner Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11Rules :
2+ - object_path : TRD_test/.*
3+ delay : 60
4+ policy : skip
5+ - object_path : no_cleanup/.*
6+ delay : 60
7+ policy : skip
8+ - object_path : ITSQcTask.*
9+ delay : 60
10+ policy : 1_per_hour
11+ - object_path : Test/.*
12+ delay : 60
13+ policy : 1_per_hour
14+ - object_path : ITSRAWDS.*
15+ delay : 60
16+ policy : 1_per_hour
17+ - object_path : ITSQCTrhesholdTask/.*
18+ delay : 60
19+ policy : 1_per_hour
220 - object_path : .* # Path in the CCDB to a certain object
321 delay : 1440 # Delay in minutes during which a new object is not touched. (1 day)
422 policy : 1_per_hour # name of the policy to apply, must correspond to a python script.
5- # - object_path: QcTask/example
6- # delay: 120
7- # policy: 1_per_hour
8-
23+
924Ccdb :
10- Url : http://ccdb-test.cern.ch:8080
25+ Url : http://ccdb-test.cern.ch:8080
Original file line number Diff line number Diff line change 1+ from datetime import datetime
2+ from datetime import timedelta
3+ import logging
4+
5+ from Ccdb import Ccdb , ObjectVersion
6+
7+
8+ def process (ccdb : Ccdb , object_path : str , delay : int ):
9+ '''
10+ Process this deletion rule on the object. We use the CCDB passed by argument.
11+
12+ This policy does nothing and allows to preserve some directories.
13+
14+ :param ccdb: the ccdb in which objects are cleaned up.
15+ :param object_path: path to the object, or pattern, to which a rule will apply.
16+ :param delay: the grace period during which a new object is never deleted.
17+ :return a dictionary with the number of deleted, preserved and updated versions. Total = deleted+preserved.
18+ '''
19+
20+ logging .debug (f"Plugin 'skip' processing { object_path } " )
21+
22+ return {"deleted" : 0 , "preserved" : 0 }
23+
24+
25+ def main ():
26+ ccdb = Ccdb ('http://ccdb-test.cern.ch:8080' )
27+ process (ccdb , "asdfasdf/example" , 60 )
28+
29+
30+ if __name__ == "__main__" : # to be able to run the test code above when not imported.
31+ main ()
You can’t perform that action at this time.
0 commit comments