Skip to content

Commit

Permalink
- improve the output of the rule skip and the printing of Versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Barthelemy committed Jan 7, 2025
1 parent 036bc2f commit 686befc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Framework/script/RepoCleaner/qcrepocleaner/Ccdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ def __init__(self, path: str, validFrom, validTo, createdAt, uuid=None, metadata
def __repr__(self):
if "Run" in self.metadata or "RunNumber" in self.metadata:
run_number = self.metadata["Run"] if "Run" in self.metadata else self.metadata["RunNumber"]
return f"Version of object {self.path} valid from {self.validFromAsDt}, run {run_number} (uuid {self.uuid})"
return f"Version of object {self.path} created at {self.createdAtDt.strftime('%Y-%m-%d %H:%M:%S')}, valid from {self.validFromAsDt.strftime('%Y-%m-%d %H:%M:%S')}, run {run_number} (uuid {self.uuid})"
else:
return f"Version of object {self.path} valid from {self.validFromAsDt} (uuid {self.uuid}, " \
return f"Version of object {self.path} created at {self.createdAtDt.strftime('%Y-%m-%d %H:%M:%S')}, valid from {self.validFromAsDt.strftime('%Y-%m-%d %H:%M:%S')} (uuid {self.uuid}, " \
f"ts {self.validFrom})"


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def downloadConfigFromConsul(consul_url: str, consul_port: str, file_name: str):
:return: the path to the config file
"""

logging.debug("Get it from consul")
logging.debug(f"Download config file from consul : {consul_url} {consul_port} {file_name}")
consul_server = consul.Consul(host=consul_url, port=consul_port)
file_path = 'o2/components/qc/ANY/any/' + file_name
index, data = consul_server.kv.get(key=file_path)
Expand Down
6 changes: 4 additions & 2 deletions Framework/script/RepoCleaner/qcrepocleaner/rules/skip.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ def process(ccdb: Ccdb, object_path: str, delay: int, from_timestamp: int, to_t
'''

logger.debug(f"Plugin 'skip' processing {object_path}")

return {"deleted" : 0, "preserved": 0}

versions = ccdb.getVersionsList(object_path)

return {"deleted": 0, "preserved": len(versions), "updated": 0}


def main():
Expand Down

0 comments on commit 686befc

Please sign in to comment.