From dd9da4ac551c14c9734210a89e6b0095b1414aca Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Mar 28 2018 13:32:05 +0000 Subject: Move up the global line to avoid the SyntaxWarning Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/lib/__init__.py b/pagure/lib/__init__.py index fd801d3..0d9f1e1 100644 --- a/pagure/lib/__init__.py +++ b/pagure/lib/__init__.py @@ -243,6 +243,7 @@ def is_valid_ssh_key(key): if proc.returncode != 0: return False + global _is_valid_ssh_key_force_md5 if _is_valid_ssh_key_force_md5 is None: # We grab the "key ID" portion of the very first key to verify the # algorithm that's default on this system. @@ -255,7 +256,6 @@ def is_valid_ssh_key(key): # Example line: # with hash: 1024 SHA256:ztcRX... root@test (RSA) # without : 1024 f9:a2:... key (RSA) - global _is_valid_ssh_key_force_md5 keyparts = stdout.split('\n')[0].split(' ')[1].split(':') if len(keyparts) == 2 or keyparts[0].upper() in ('MD5', 'SHA256'): # This means that we get a keyid of HASH: rather than just