diff --git a/lib/rucio/common/policy.py b/lib/rucio/common/policy.py index e84e05834f..06610fc7b3 100644 --- a/lib/rucio/common/policy.py +++ b/lib/rucio/common/policy.py @@ -16,6 +16,7 @@ import os from configparser import NoOptionError, NoSectionError from functools import wraps +from typing import Any from dogpile.cache import make_region from dogpile.cache.api import NoValue @@ -27,7 +28,7 @@ expiration_time=900) -def get_policy(): +def get_policy() -> str: policy = REGION.get('policy') if isinstance(policy, NoValue): try: @@ -38,7 +39,7 @@ def get_policy(): return policy -def get_scratchdisk_lifetime(): +def get_scratchdisk_lifetime() -> int: scratchdisk_lifetime = REGION.get('scratchdisk_lifetime') if isinstance(scratchdisk_lifetime, NoValue): try: @@ -50,7 +51,7 @@ def get_scratchdisk_lifetime(): return scratchdisk_lifetime -def get_lifetime_policy(): +def get_lifetime_policy() -> dict[str, list[dict[str, Any]]]: lifetime_dict = REGION.get('lifetime_dict') if isinstance(lifetime_dict, NoValue): lifetime_dict = {'data': [], 'mc': [], 'valid': [], 'other': []}