Skip to content

Commit

Permalink
Typing: Add type annotations to credential.py; #6454
Browse files Browse the repository at this point in the history
  • Loading branch information
rdimaio authored and bari12 committed Mar 21, 2024
1 parent b3d6b57 commit be8b950
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/rucio/core/credential.py
Expand Up @@ -37,7 +37,7 @@
METRICS = MetricManager(module=__name__)


def get_signed_url(rse_id: str, service: str, operation: str, url: str, lifetime=600) -> str:
def get_signed_url(rse_id: str, service: str, operation: str, url: str, lifetime: int = 600) -> str:
"""
Get a signed URL for a particular service and operation.
Expand Down Expand Up @@ -87,8 +87,8 @@ def get_signed_url(rse_id: str, service: str, operation: str, url: str, lifetime
else:
# GCS is timezone-sensitive, don't use UTC
# has to be converted to Unixtime
lifetime = datetime.datetime.now() + datetime.timedelta(seconds=lifetime)
lifetime = int(time.mktime(lifetime.timetuple()))
lifetime_datetime = datetime.datetime.now() + datetime.timedelta(seconds=lifetime)
lifetime = int(time.mktime(lifetime_datetime.timetuple()))

# sign the path only
path = components.path
Expand Down

0 comments on commit be8b950

Please sign in to comment.