Skip to content

Commit

Permalink
Auth: ssh_sign, remove isinstance(message, str) check
Browse files Browse the repository at this point in the history
There are no usages of ssh_sign where "message" is anything
other than a string, and it is best if we always expect it
to be a string.

Follow-up from this PR: rucio#6497
  • Loading branch information
rdimaio committed Apr 8, 2024
1 parent 7fedc87 commit 5496213
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/rucio/common/utils.py
Expand Up @@ -1279,8 +1279,7 @@ def ssh_sign(private_key, message):
:param message: The message to sign as a string.
:return: Base64 encoded signature as a string.
"""
if isinstance(message, str):
message = message.encode()
message = message.encode()
if not EXTRA_MODULES['paramiko']:
raise MissingModuleException('The paramiko module is not installed or faulty.')
sio_private_key = StringIO(private_key)
Expand Down

0 comments on commit 5496213

Please sign in to comment.