On 11/24/2015 05:01 PM, Martin Babinsky wrote:
On 11/24/2015 04:58 PM, Jan Cholasta wrote:
On 24.11.2015 16:48, Martin Babinsky wrote:
On 11/24/2015 04:44 PM, Martin Babinsky wrote:
https://fedorahosted.org/freeipa/ticket/5459

forgot to attach the actual file *slaps himself*

ipaserver/install/cainstance.py:1849: [E1101(no-member),
ensure_default_caacl] Instance of 'API' has no 'Backed' member)


Fixed



Also attaching rebased patch for ipa-4-2

--
Martin^3 Babinsky
From 0ed648bebd9f09a099b74fab2d6dcd16dfc6cb14 Mon Sep 17 00:00:00 2001
From: Martin Babinsky <mbabi...@redhat.com>
Date: Tue, 24 Nov 2015 16:40:52 +0100
Subject: [PATCH] do not disconnect when using existing connection to check
 default CA ACLs

https://fedorahosted.org/freeipa/ticket/5459
---
 ipaserver/install/cainstance.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/ipaserver/install/cainstance.py b/ipaserver/install/cainstance.py
index 189876f3c0d980e78165d73eed86b2830ac8c5b8..c20bf39c12cff0777d90efad2b0d8d136ee37ec9 100644
--- a/ipaserver/install/cainstance.py
+++ b/ipaserver/install/cainstance.py
@@ -1846,7 +1846,8 @@ def _create_dogtag_profile(profile_id, profile_data):
 
 def ensure_default_caacl():
     """Add the default CA ACL if missing."""
-    if not api.Backend.ldap2.isconnected():
+    is_already_connected = api.Backend.ldap2.isconnected()
+    if not is_already_connected:
         try:
             api.Backend.ldap2.connect(autobind=True)
         except errors.PublicError as e:
@@ -1870,6 +1871,9 @@ def ensure_default_caacl():
         api.Command.caacl_add_profile(u'hosts_services_caIPAserviceCert',
             certprofile=(u'caIPAserviceCert',))
 
+    if not is_already_connected:
+        api.Backend.ldap2.disconnect()
+
 
 if __name__ == "__main__":
     standard_logging_setup("install.log")
-- 
2.4.3

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to