[Pkg-privacy-commits] [torbrowser-launcher] 05/48: Add pre-import check that signing keyfile exists; remove asserts

Roger Shimizu rosh at moszumanska.debian.org
Mon Sep 4 16:42:31 UTC 2017


This is an automated email from the git hooks/post-receive script.

rosh pushed a commit to branch debian/sid
in repository torbrowser-launcher.

commit 57cf1147d21a575d6e3e01873c0ca8fc9457696a
Author: Kajisav <dan at dephekt.net>
Date:   Sat Mar 4 01:13:12 2017 -0600

    Add pre-import check that signing keyfile exists; remove asserts
---
 torbrowser_launcher/common.py | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/torbrowser_launcher/common.py b/torbrowser_launcher/common.py
index 225725f..38fa968 100644
--- a/torbrowser_launcher/common.py
+++ b/torbrowser_launcher/common.py
@@ -196,7 +196,6 @@ class Common:
 
     def import_key_and_check_status(self, key):
         """Import a GnuPG key and check that the operation was successful.
-        
         :param str key: A string specifying the key's filepath from
             ``Common.paths``
         :rtype: bool
@@ -209,14 +208,14 @@ class Common:
             
             # try to gpg import key data
             impkey = self.paths['signing_keys'][key]
-            c.op_import(gpg.Data(file=impkey))
-            
+            if os.path.isfile(impkey):
+                c.op_import(gpg.Data(file=impkey))
+            else:
+                print _("Signing key not found")
+        
             # store import results, if any then return result
             result = c.op_import_result()
             if result:
-                assert not result.considered == 0
-                assert result.no_user_id == 0
-                assert result.not_imported == 0
                 return True
             else:
                 return False
@@ -224,7 +223,6 @@ class Common:
     # import gpg keys
     def import_keys(self):
         """Import all GnuPG keys.
-
         :rtype: bool
         :returns: ``True`` if all keys were successfully imported; ``False``
             otherwise.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/torbrowser-launcher.git



More information about the Pkg-privacy-commits mailing list