summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2009-01-18 05:59:25 -0800
committerLuis R. Rodriguez <lrodriguez@atheros.com>2009-01-18 07:33:31 -0800
commitb4537da17ab5f32d1520155b7d62a329387c95f2 (patch)
tree059bf7ef1f68d5073239af74a821219f94366fbd /utils
parent8960257368539400428dd7ea5cddd761ad027bc4 (diff)
downloadcrda-b4537da17ab5f32d1520155b7d62a329387c95f2.tar.gz
crda-b4537da17ab5f32d1520155b7d62a329387c95f2.tar.bz2
crda-b4537da17ab5f32d1520155b7d62a329387c95f2.zip
crda: Throw verbose error message if M2Crypto is missing
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>
Diffstat (limited to 'utils')
-rwxr-xr-xutils/key2pub.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/utils/key2pub.py b/utils/key2pub.py
index 47f50e3..74aa28d 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':