From ec0e8626a4548d6480b346931e1f501ebd0e0269 Mon Sep 17 00:00:00 2001 From: rdimaio Date: Mon, 8 Apr 2024 10:56:52 +0200 Subject: [PATCH] Auth: ssh_sign, remove isinstance(message, str) check 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: https://github.com/rucio/rucio/pull/6497 --- lib/rucio/common/utils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/rucio/common/utils.py b/lib/rucio/common/utils.py index 143e9a2597..d3af0d8505 100644 --- a/lib/rucio/common/utils.py +++ b/lib/rucio/common/utils.py @@ -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)