commit:     b0402fd5d51b95ca32705936444ae082f4b3a5c4
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Mon Jun  1 01:56:24 2015 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Jun  1 01:56:24 2015 +0000
URL:        https://gitweb.gentoo.org/proj/gentoo-keys.git/commit/?id=b0402fd5

gkeys/actions.py: verify url was not smart about being passed a sig url and 
would fail to verify

Move EXTENSIONS out as a constant instead of being defined twice.

 gkeys/gkeys/actions.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/gkeys/gkeys/actions.py b/gkeys/gkeys/actions.py
index 24c323e..7275739 100644
--- a/gkeys/gkeys/actions.py
+++ b/gkeys/gkeys/actions.py
@@ -36,6 +36,10 @@ demandload(
     "gkeys.seedhandler:SeedHandler",
 )
 
+
+EXTENSIONS = ['.sig', '.asc', '.gpg','.gpgsig']
+
+
 class Actions(object):
     '''Primary API actions'''
 
@@ -754,9 +758,8 @@ class Actions(object):
                 url, filepath, timestamp_path)
             if not success:
                 messages.append(_unicode("File %s cannot be retrieved.") % 
filepath)
-            else:
+            elif '.' + url.rsplit('.', 1)[1] not in EXTENSIONS:
                 if not signature:
-                    EXTENSIONS = ['.sig', '.asc', 'gpg','.gpgsig']
                     success_fetch = False
                     for ext in EXTENSIONS:
                         sig_path = filepath + ext
@@ -776,7 +779,6 @@ class Actions(object):
                 _unicode("ACTIONS: verify; local file %s") % filepath)
             success = os.path.isfile(filepath)
             if not signature:
-                EXTENSIONS = ['.sig', '.asc', 'gpg','.gpgsig']
                 success_fetch = False
                 for ext in EXTENSIONS:
                     sig_path = filepath + ext

Reply via email to