From 68ccd17b695293a4019ff7a751706686b9c84506 Mon Sep 17 00:00:00 2001 From: voetberg Date: Mon, 5 Aug 2024 10:21:42 -0500 Subject: [PATCH] Common: Correct header to most recent version, sort imports --- common/check_expired_locked_rules | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/common/check_expired_locked_rules b/common/check_expired_locked_rules index af4dff5..bd49bcd 100755 --- a/common/check_expired_locked_rules +++ b/common/check_expired_locked_rules @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright 2012-2024 CERN +# Copyright European Organization for Nuclear Research (CERN) since 2012 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,26 +12,22 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# -# Authors: -# - Cedric Serfon, , 2015 -# - Donata Mielaikaite, , 2020 -# - Eric Vaandering, , 2020 -# - Maggie Voetberg , 2024 -''' +""" Probe to check the locked expired rules or datasets with locked rules -''' +""" -from collections import defaultdict import datetime import sys import traceback -from sqlalchemy import select, and_ -from sqlalchemy.sql import true, null +from collections import defaultdict + +from sqlalchemy import and_, select +from sqlalchemy.sql import null, true from rucio.db.sqla import models, session + from utils.common import PrometheusPusher # Exit statuses @@ -114,7 +110,7 @@ if __name__ == '__main__': .labels(rse_expression=rse_expression) .set(dids)) - except: + except Exception: print(traceback.format_exc()) sys.exit(UNKNOWN)