summaryrefslogtreecommitdiffstats
path: root/ipapython
diff options
context:
space:
mode:
authorJan Cholasta <jcholast@redhat.com>2011-12-07 03:15:45 -0500
committerRob Crittenden <rcritten@redhat.com>2012-02-13 22:21:35 -0500
commit04b8575c52410bb6d31e0e55f1cf431d7cc9c7c3 (patch)
tree383c9e36b594493255d47b17396446e27d171473 /ipapython
parent3c2b0fc28ae21c7e4b26961e28e2eb0ba0559d29 (diff)
downloadfreeipa-04b8575c52410bb6d31e0e55f1cf431d7cc9c7c3.tar.gz
freeipa-04b8575c52410bb6d31e0e55f1cf431d7cc9c7c3.tar.xz
freeipa-04b8575c52410bb6d31e0e55f1cf431d7cc9c7c3.zip
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
Diffstat (limited to 'ipapython')
-rw-r--r--ipapython/nsslib.py6
1 files changed, 5 insertions, 1 deletions
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)