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

--
Martin^3 Babinsky
From 2c87ea0c6b2b91ae344985138dce6c555cfe8578 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 | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ipaserver/install/cainstance.py b/ipaserver/install/cainstance.py
index cca27e9d2a4767e91771a918c12b2c852dc29161..8a8ae2fc5802271f115c79a78c04fde70977f754 100644
--- a/ipaserver/install/cainstance.py
+++ b/ipaserver/install/cainstance.py
@@ -2004,7 +2004,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:
@@ -2028,7 +2029,7 @@ def ensure_default_caacl():
         api.Command.caacl_add_profile(u'hosts_services_caIPAserviceCert',
             certprofile=(u'caIPAserviceCert',))
 
-    if api.Backend.ldap2.isconnected():
+    if not is_already_connected:
         api.Backend.ldap2.disconnect()
 
 
-- 
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