[dak/master 1/5] Remove use of GPGKeyring and use database
Signed-off-by: Mark Hymers <mhy@debian.org>
---
dak/add_user.py | 4 ++--
daklib/utils.py | 9 ++++++---
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/dak/add_user.py b/dak/add_user.py
index f087849..f2391bd 100755
--- a/dak/add_user.py
+++ b/dak/add_user.py
@@ -22,7 +22,7 @@ import sys
import apt_pkg
from daklib import utils
-from daklib.dbconn import DBConn, get_or_set_uid
+from daklib.dbconn import DBConn, get_or_set_uid, get_active_keyring_paths
from daklib.regexes import re_gpg_fingerprint_colon, re_user_address, re_user_mails, re_user_name
################################################################################
@@ -124,7 +124,7 @@ def main():
session = DBConn().session()
if not keyrings:
- keyrings = Cnf.ValueList("Dinstall::GPGKeyring")
+ keyrings = get_active_keyring_paths()
cmd = "gpg --with-colons --no-secmem-warning --no-auto-check-trustdb --no-default-keyring %s --with-fingerprint --list-key %s" \
% (utils.gpg_keyring_args(keyrings),
diff --git a/daklib/utils.py b/daklib/utils.py
index 413bcb6..133500c 100755
--- a/daklib/utils.py
+++ b/daklib/utils.py
@@ -39,7 +39,10 @@ import re
import email as modemail
import subprocess
-from dbconn import DBConn, get_architecture, get_component, get_suite, get_override_type, Keyring, session_wrapper
+from dbconn import DBConn, get_architecture, get_component, get_suite, \
+ get_override_type, Keyring, session_wrapper, \
+ get_active_keyring_paths, get_primary_keyring_path
+from sqlalchemy import desc
from dak_exceptions import *
from gpg import SignedFile
from textutils import fix_maintainer
@@ -1250,7 +1253,7 @@ def retrieve_key (filename, keyserver=None, keyring=None):
if not keyserver:
keyserver = Cnf["Dinstall::KeyServer"]
if not keyring:
- keyring = Cnf.ValueList("Dinstall::GPGKeyring")[0]
+ keyring = get_primary_keyring_path()
# Ensure the filename contains no shell meta-characters or other badness
if not re_taint_free.match(filename):
@@ -1287,7 +1290,7 @@ def retrieve_key (filename, keyserver=None, keyring=None):
def gpg_keyring_args(keyrings=None):
if not keyrings:
- keyrings = Cnf.ValueList("Dinstall::GPGKeyring")
+ keyrings = get_active_keyring_paths()
return " ".join(["--keyring %s" % x for x in keyrings])
--
1.7.2.5
Reply to: