summaryrefslogtreecommitdiff
blob: c77f26649ce60ad9f32543c3440dfa9bbae2bdb4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
From 19b61c3b0dc31ee60341b3ca708f8e459e44ce3f Mon Sep 17 00:00:00 2001
From: Phil Dibowitz <phil@ipom.com>
Date: Mon, 23 Mar 2020 08:57:09 -0700
Subject: [PATCH] Minor fixes for pius-report (#137)

Signed-off-by: Phil Dibowitz <phil@ipom.com>
---
 libpius/mailer.py | 2 +-
 pius-keyring-mgr  | 4 +++-
 pius-report       | 5 +++--
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/libpius/mailer.py b/libpius/mailer.py
index ba6b50a..f5b097f 100644
--- a/libpius/mailer.py
+++ b/libpius/mailer.py
@@ -403,7 +403,7 @@ class PiusMailer:
                 # BCC the user...
                 env_to = [msg["To"], self.mail]
 
-            smtp.sendmail(self.mail, env_to, msg.as_string())
+            smtp.sendmail(self.mail, env_to, msg.as_string().encode('utf-8'))
             smtp.quit()
         except smtplib.SMTPException as emsg:
             raise MailSendError(emsg)
diff --git a/pius-keyring-mgr b/pius-keyring-mgr
index fb0b46a..ec3528a 100755
--- a/pius-keyring-mgr
+++ b/pius-keyring-mgr
@@ -1,4 +1,5 @@
 #!/usr/bin/env python3
+
 """A utility to create and manage party keyrings."""
 
 # vim:tw=80:ai:tabstop=4:expandtab:shiftwidth=4
@@ -446,7 +447,7 @@ class KeyringBuilder:
     # stolen from pius
     def get_all_keyids(self, sort_keyring):
         """Given a keyring, get all the KeyIDs from it."""
-        util.debug("extracting all keyids from keyring")
+        util.debug("extracting all keyids from keyring, sort: %s" % sort_keyring)
         extra_opts = GPG_QUIET_OPTS + self.AUTO_OPTS + ["--fixed-list-mode"]
         cmd = self.basecmd + extra_opts + ["--fingerprint"]
         util.logcmd(cmd)
@@ -776,6 +777,7 @@ before distributing they keyring.
     prune.add_option(
         "--no-sort-keyring",
         dest="sort_keyring",
+        default=True,
         action="store_false",
         help="Do not sort the keyring by name.",
     )
diff --git a/pius-report b/pius-report
index 47f57b5..744da35 100755
--- a/pius-report
+++ b/pius-report
@@ -15,7 +15,8 @@ from optparse import OptionParser
 from libpius import mailer as pmailer
 from libpius import signer as psigner
 from libpius.util import PiusUtil, MyOption
-from libpius.constants import DEFAULT_GPG_PATH, UID_RE, GPG_MIN_OPTS
+from libpius.constants import DEFAULT_GPG_PATH, UID_RE, GPG_MIN_OPTS, \
+    GPG_BASE_OPTS
 from libpius.exceptions import MailSendError
 from libpius.state import SignState
 
@@ -401,7 +402,7 @@ Generated by PIUS Report BETA (http://www.phildev.net/pius/).
 
 def refresh_keys(gpg, keys):
     cmd = [gpg] + GPG_MIN_OPTS + ["--refresh-keys"] + keys
-    PiusPiusUtil.logcmd(cmd)
+    PiusUtil.logcmd(cmd)
     gpg = subprocess.Popen(cmd, stdout=subprocess.PIPE, close_fds=True)
     gpg.wait()
 
-- 
2.29.2