Conditionally import nss

python-nss does not exist (and is not needed) in RHEL8.
We need to conditionally import nss to avoid errors in RHEL8.

Change-Id: I699fbfab4c2106f24260c99905b1bd40a8e683a8
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1758771
This commit is contained in:
Ade Lee authored and Grzegorz Grasza committed 2019-12-04 16:35:04 +00:00
1 parent 4aa08a25b8
commit e418762753
1 file changed
+2 -2
+2 -2
View File
@@ -52,8 +52,6 @@ except ImportError:
if version.NUM_VERSION >= 40500:
from cryptography.hazmat.primitives import serialization
import nss.nss as nss
logger = logging.getLogger()
allowed_chars = string.ascii_letters + string.digits
@@ -171,6 +169,8 @@ class NovajoinRole(object):
NOTE: For IPA v4.4.0.
"""
import nss.nss as nss
nss.nss_init_nodb()
nss_db = certdb.NSSDatabase()