From 9cc3e56129661ca157e24c0947af951f58855918 Mon Sep 17 00:00:00 2001 From: Lubomír Sedlář Date: Apr 22 2018 13:29:43 +0000 Subject: Move global declaration to top of function --- diff --git a/pagure/lib/__init__.py b/pagure/lib/__init__.py index 3f4a35e..3ba29c3 100644 --- a/pagure/lib/__init__.py +++ b/pagure/lib/__init__.py @@ -225,6 +225,7 @@ _is_valid_ssh_key_force_md5 = None def is_valid_ssh_key(key): """ Validates the ssh key using ssh-keygen. """ + global _is_valid_ssh_key_force_md5 key = key.strip() if not key: return None @@ -243,7 +244,6 @@ 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.