All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Lehtonen <markus.lehtonen@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 2/3] oe/gpg_sign: check for python-pexpect when using local signing
Date: Fri,  5 Feb 2016 16:00:23 +0200	[thread overview]
Message-ID: <1454680824-26075-3-git-send-email-markus.lehtonen@linux.intel.com> (raw)
In-Reply-To: <1454680824-26075-1-git-send-email-markus.lehtonen@linux.intel.com>

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
---
 meta/lib/oe/gpg_sign.py | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/meta/lib/oe/gpg_sign.py b/meta/lib/oe/gpg_sign.py
index 8832ea9..ea35564 100644
--- a/meta/lib/oe/gpg_sign.py
+++ b/meta/lib/oe/gpg_sign.py
@@ -17,13 +17,17 @@ class LocalSigner(object):
     @classmethod
     def check_sanity(cls, d, keyid, passphrase_file):
         """(Pre-)check the sanity of a configuration"""
-        msg = ""
+        msgs = []
+        try:
+            import pexpect
+        except ImportError:
+            msgs.append("Please install python-pexpect that is needed by lcocal gpg signing.")
         missing_vars = ['%(keyid)s'] if not keyid else []
         if not passphrase_file:
             missing_vars.append('%(passphrase_file)s')
         if missing_vars:
-            msg += "You need to define " + ' and '.join(missing_vars) + " in the config."
-        return msg
+            msgs.append("You need to define " + ' and '.join(missing_vars) + " in the config.")
+        return ' '.join(msgs)
 
     def export_pubkey(self, output_file):
         """Export GPG public key to a file"""
-- 
2.6.2



  parent reply	other threads:[~2016-02-05 14:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-05 14:00 [PATCH 0/3] signing: enhance sanity checking Markus Lehtonen
2016-02-05 14:00 ` [PATCH 1/3] package signing: do actual sanity checking in the signer class Markus Lehtonen
2016-02-05 14:00 ` Markus Lehtonen [this message]
2016-02-05 14:31   ` [PATCH 2/3] oe/gpg_sign: check for python-pexpect when using local signing Burton, Ross
2016-02-08 10:52     ` Markus Lehtonen
2016-02-08 11:17       ` Ioan-Adrian Ratiu
2016-02-05 14:00 ` [PATCH 3/3] package signing: do sanity checking in an event handler Markus Lehtonen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1454680824-26075-3-git-send-email-markus.lehtonen@linux.intel.com \
    --to=markus.lehtonen@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.