linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] crda: Throw verbose error message if M2Crypto is missing
@ 2009-01-18 13:59 Michael Buesch
  2009-01-18 15:34 ` Luis R. Rodriguez
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Buesch @ 2009-01-18 13:59 UTC (permalink / raw)
  To: Luis Rodriguez; +Cc: linux-wireless

Instead of throwing a cryptic Python backtrace, throw a better error message, if
the M2Crypto module is not installed.

Signed-off-by: Michael Buesch <mb@bu3sch.de>

---

diff --git a/utils/key2pub.py b/utils/key2pub.py
index 47f50e3..f8918fc 100755
--- a/utils/key2pub.py
+++ b/utils/key2pub.py
@@ -1,7 +1,13 @@
 #!/usr/bin/env python
 
 import sys
-from M2Crypto import RSA
+try:
+	from M2Crypto import RSA
+except ImportError, e:
+	sys.stderr.write('ERROR: Failed to import the "M2Crypto" module: %s\n' % e.message)
+	sys.stderr.write('Please install the "M2Crypto" Python module.\n')
+	sys.stderr.write('On Debian GNU/Linux the package is called "python-m2crypto".\n')
+	sys.exit(1)
 
 def print_ssl(output, name, val):
     while val[0] == '\0':

-- 
Greetings, Michael.

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] crda: Throw verbose error message if M2Crypto is missing
  2009-01-18 13:59 [PATCH] crda: Throw verbose error message if M2Crypto is missing Michael Buesch
@ 2009-01-18 15:34 ` Luis R. Rodriguez
  0 siblings, 0 replies; 2+ messages in thread
From: Luis R. Rodriguez @ 2009-01-18 15:34 UTC (permalink / raw)
  To: Michael Buesch; +Cc: Luis Rodriguez, linux-wireless@vger.kernel.org

On Sun, Jan 18, 2009 at 05:59:25AM -0800, Michael Buesch wrote:
> Instead of throwing a cryptic Python backtrace, throw a better error message, if
> the M2Crypto module is not installed.
> 
> Signed-off-by: Michael Buesch <mb@bu3sch.de>

Thanks applied.

  Luis

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-01-18 15:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-18 13:59 [PATCH] crda: Throw verbose error message if M2Crypto is missing Michael Buesch
2009-01-18 15:34 ` Luis R. Rodriguez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).