diff options
author | Jason DeTiberus <detiber@gmail.com> | 2016-11-29 10:37:46 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-29 10:37:46 -0500 |
commit | 244132714dac209ebebe9141a58da5d2e9f1bb13 (patch) | |
tree | 14b6ca875d1340fd44c83869346a1a22b6a8461d | |
parent | 73628ff2726b92c2ad98ae77aa88a8a84be2b86d (diff) | |
parent | 698ad269005c0d053aafdb9fd1f29683f13d1398 (diff) | |
download | openshift-244132714dac209ebebe9141a58da5d2e9f1bb13.tar.gz openshift-244132714dac209ebebe9141a58da5d2e9f1bb13.tar.bz2 openshift-244132714dac209ebebe9141a58da5d2e9f1bb13.tar.xz openshift-244132714dac209ebebe9141a58da5d2e9f1bb13.zip |
Merge pull request #2870 from mscherer/fix_2869
Gracefully handle OpenSSL module absence
-rw-r--r-- | filter_plugins/oo_filters.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/filter_plugins/oo_filters.py b/filter_plugins/oo_filters.py index 38bc3ad6b..997634777 100644 --- a/filter_plugins/oo_filters.py +++ b/filter_plugins/oo_filters.py @@ -10,7 +10,14 @@ from collections import Mapping from distutils.util import strtobool from distutils.version import LooseVersion from operator import itemgetter -import OpenSSL.crypto + +HAS_OPENSSL=False +try: + import OpenSSL.crypto + HAS_OPENSSL=True +except ImportError: + pass + import os import pdb import pkg_resources @@ -516,6 +523,9 @@ class FilterModule(object): if not isinstance(internal_hostnames, list): raise errors.AnsibleFilterError("|failed expects internal_hostnames is list") + if not HAS_OPENSSL: + raise errors.AnsibleFilterError("|missing OpenSSL python bindings") + for certificate in certificates: if 'names' in certificate.keys(): continue |