diff options
author | Sol Jerome <sol.jerome@gmail.com> | 2012-08-13 15:27:43 -0500 |
---|---|---|
committer | Sol Jerome <sol.jerome@gmail.com> | 2012-08-13 15:27:43 -0500 |
commit | d51e90c092efc2ab493bea05cfc0b8e06aabb765 (patch) | |
tree | 20d5a924bedef4c6b52b6b05aff90604da51d822 /src/sbin/bcfg2-crypt | |
parent | c4c3bee8d74abaa8029c01f68e3a49c739a3bc42 (diff) | |
download | bcfg2-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/sbin/bcfg2-crypt')
-rwxr-xr-x | src/sbin/bcfg2-crypt | 8 |
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 |