diff --git a/Framework/script/RepoCleaner/README.md b/Framework/script/RepoCleaner/README.md index 173ef5634..cfe345173 100644 --- a/Framework/script/RepoCleaner/README.md +++ b/Framework/script/RepoCleaner/README.md @@ -35,12 +35,13 @@ The configuration for ccdb-test is described [here](../../../doc/DevelopersTips. ## Setup virtual environment for development and test (venv) -1. cd Framework/script/RepoCleaner -2. python3 -m venv env -3. source env/bin/activate -4. python -m pip install -r requirements.txt -5. python3 -m pip install . +1. `cd Framework/script/RepoCleaner` +2. `python3 -m venv env` +3. `source env/bin/activate` +4. `python -m pip install -r requirements.txt` +5. `python3 -m pip install . ` 6. You can execute and work. Next time just do "activate" and then you are good to go +7. If you modify the code, then rerun `python3 -m pip install .` ## Unit Tests @@ -50,6 +51,9 @@ source env/bin/activate # Run a test: python -m unittest tests.test_Ccdb.TestCcdb.test_getObjectsList + +# Run all tests: +python3 -m unittest discover` ``` `cd QualityControl/Framework/script/RepoCleaner ; python3 -m unittest discover` diff --git a/Framework/script/RepoCleaner/qcrepocleaner/o2-qc-repo-delete-objects-in-runs b/Framework/script/RepoCleaner/qcrepocleaner/o2-qc-repo-delete-objects-in-runs index ce6f41646..86e5f9971 100755 --- a/Framework/script/RepoCleaner/qcrepocleaner/o2-qc-repo-delete-objects-in-runs +++ b/Framework/script/RepoCleaner/qcrepocleaner/o2-qc-repo-delete-objects-in-runs @@ -28,6 +28,8 @@ def parseArgs(): parser.add_argument('--one-by-one', action='store_true', help='Ask confirmation for each deletion') parser.add_argument('--print-list', action='store_true', help='Only print the list of objects that would be deleted') parser.add_argument('--yes', action='store_true', help='Answers yes to all. You should really not use that.') + parser.add_argument('--metadata', dest='metadata', action='store', default="", + help='Delete only versions matching these metadata. Format: "[/key=value]*"') args = parser.parse_args() dryable.set(args.dry_run) logging.info(args) @@ -47,7 +49,11 @@ def run(args): run_number = row["runNumber"] logging.info(f"Run : {run_number}") +<<<<<<< Updated upstream versions = ccdb.getVersionsList(args.path + "/.*", "", "", run_number) +======= + versions = ccdb.get_versions_list(args.path + "/.*", "", "", run_number, metadata=args.metadata) +>>>>>>> Stashed changes logging.info("Here are the objects that are going to be deleted: ") for v in versions: logging.info(v)