From 04b8575c52410bb6d31e0e55f1cf431d7cc9c7c3 Mon Sep 17 00:00:00 2001 From: Jan Cholasta Date: Wed, 7 Dec 2011 03:15:45 -0500 Subject: Add API initialization to ipa-client-install. This change makes it possible to call IPA commands from ipa-client-install. Done to support adding SSH host keys to DNS. https://fedorahosted.org/freeipa/ticket/1634 --- ipapython/nsslib.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ipapython/nsslib.py') diff --git a/ipapython/nsslib.py b/ipapython/nsslib.py index 37b02f929..225551932 100644 --- a/ipapython/nsslib.py +++ b/ipapython/nsslib.py @@ -201,7 +201,11 @@ class NSSConnection(httplib.HTTPConnection, NSSAddressFamilyFallback): if nss.nss_is_initialized(): # close any open NSS database and use the new one ssl.clear_session_cache() - nss.nss_shutdown() + try: + nss.nss_shutdown() + except NSPRError, e: + if e.errno != error.SEC_ERROR_NOT_INITIALIZED: + raise e nss.nss_init(dbdir) ssl.set_domestic_policy() nss.set_password_callback(self.password_callback) -- cgit