summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSol Jerome <sol.jerome@gmail.com>2012-08-13 15:27:43 -0500
committerSol Jerome <sol.jerome@gmail.com>2012-08-13 15:27:43 -0500
commitd51e90c092efc2ab493bea05cfc0b8e06aabb765 (patch)
tree20d5a924bedef4c6b52b6b05aff90604da51d822 /src
parentc4c3bee8d74abaa8029c01f68e3a49c739a3bc42 (diff)
downloadbcfg2-d51e90c092efc2ab493bea05cfc0b8e06aabb765.tar.gz
bcfg2-d51e90c092efc2ab493bea05cfc0b8e06aabb765.tar.bz2
bcfg2-d51e90c092efc2ab493bea05cfc0b8e06aabb765.zip
bcfg2-crypt: Prevent traceback when missing M2Crypto
Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
Diffstat (limited to 'src')
-rwxr-xr-xsrc/sbin/bcfg2-crypt8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/sbin/bcfg2-crypt b/src/sbin/bcfg2-crypt
index 89dfe3e2a..79f9e26a2 100755
--- a/src/sbin/bcfg2-crypt
+++ b/src/sbin/bcfg2-crypt
@@ -7,7 +7,13 @@ import logging
import lxml.etree
import Bcfg2.Logger
import Bcfg2.Options
-import Bcfg2.Encryption
+try:
+ import Bcfg2.Encryption
+except ImportError:
+ err = sys.exc_info()[1]
+ print("Import failed '%s'. Is M2Crypto installed?" %
+ err)
+ raise SystemExit(1)
LOGGER = None