Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typing: Add type annotations to credential.py #6558

Merged
merged 1 commit into from Mar 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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