From 3e2ee756f9b0a719e746e6471fab2de41998f1d0 Mon Sep 17 00:00:00 2001 From: Thomas S Hatch Date: Sun, 30 Sep 2012 16:08:59 -0600 Subject: [PATCH] Fix #2132 --- salt/modules/ca.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/salt/modules/ca.py b/salt/modules/ca.py index a5318a7f5ba9..0bfb6e8b3d56 100644 --- a/salt/modules/ca.py +++ b/salt/modules/ca.py @@ -19,7 +19,13 @@ import time import logging import hashlib -import OpenSSL + +has_ssl = False +try: + import OpenSSL + has_ssl = True +except ImportError: + pass # Import Salt libs from salt.exceptions import CommandExecutionError @@ -30,7 +36,9 @@ def __virtual__(): ''' Only load this module if the ca config options are set ''' - return 'ca' + if has_ssl: + return 'ca' + return False def _cert_base_path():