summaryrefslogtreecommitdiffstats
path: root/ipaserver/install
diff options
context:
space:
mode:
authorJan Cholasta <jcholast@redhat.com>2015-06-22 10:58:43 +0000
committerJan Cholasta <jcholast@redhat.com>2015-07-01 13:05:30 +0000
commite39fe4ed31042bd28357d093fdbd93b4d6d59aaa (patch)
treec9edd3b3d710ae642d91eb8ca0c060cb5f6d0f0c /ipaserver/install
parent2d1515323acb4125306817096bafab6623de0b47 (diff)
downloadfreeipa-e39fe4ed31042bd28357d093fdbd93b4d6d59aaa.tar.gz
freeipa-e39fe4ed31042bd28357d093fdbd93b4d6d59aaa.tar.xz
freeipa-e39fe4ed31042bd28357d093fdbd93b4d6d59aaa.zip
plugable: Pass API to plugins on initialization rather than using set_api
https://fedorahosted.org/freeipa/ticket/3090 Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
Diffstat (limited to 'ipaserver/install')
-rw-r--r--ipaserver/install/bindinstance.py2
-rw-r--r--ipaserver/install/cainstance.py8
-rw-r--r--ipaserver/install/ipa_cacert_manage.py2
-rw-r--r--ipaserver/install/ipa_otptoken_import.py2
-rw-r--r--ipaserver/install/ipa_replica_prepare.py2
-rw-r--r--ipaserver/install/server/install.py3
6 files changed, 9 insertions, 10 deletions
diff --git a/ipaserver/install/bindinstance.py b/ipaserver/install/bindinstance.py
index 102a8e5f6..2228342dc 100644
--- a/ipaserver/install/bindinstance.py
+++ b/ipaserver/install/bindinstance.py
@@ -1179,7 +1179,7 @@ class BindInstance(service.Service):
print "Global DNS configuration in LDAP server is not empty"
print "The following configuration options override local settings in named.conf:"
print ""
- textui = ipalib.cli.textui()
+ textui = ipalib.cli.textui(api)
api.Command.dnsconfig_show.output_for_cli(textui, result, None, reverse=False)
def uninstall(self):
diff --git a/ipaserver/install/cainstance.py b/ipaserver/install/cainstance.py
index 884d27a91..5fd3017e1 100644
--- a/ipaserver/install/cainstance.py
+++ b/ipaserver/install/cainstance.py
@@ -1588,7 +1588,7 @@ def update_people_entry(dercert):
while attempts < 10:
conn = None
try:
- conn = ldap2.ldap2(shared_instance=False, ldap_uri=dogtag_uri)
+ conn = ldap2.ldap2(api, ldap_uri=dogtag_uri)
conn.connect(autobind=True)
db_filter = conn.make_filter(
@@ -1643,7 +1643,7 @@ def ensure_ldap_profiles_container():
server_id = installutils.realm_to_serverid(api.env.realm)
dogtag_uri = 'ldapi://%%2fvar%%2frun%%2fslapd-%s.socket' % server_id
- conn = ldap2.ldap2(shared_instance=False, ldap_uri=dogtag_uri)
+ conn = ldap2.ldap2(api, ldap_uri=dogtag_uri)
if not conn.isconnected():
conn.connect(autobind=True)
@@ -1675,7 +1675,7 @@ def configure_profiles_acl():
)
modlist = [(ldap.MOD_ADD, 'resourceACLS', [rule])]
- conn = ldap2.ldap2(shared_instance=False, ldap_uri=dogtag_uri)
+ conn = ldap2.ldap2(api, ldap_uri=dogtag_uri)
if not conn.isconnected():
conn.connect(autobind=True)
rules = conn.get_entry(dn).get('resourceACLS', [])
@@ -1696,7 +1696,7 @@ def import_included_profiles():
server_id = installutils.realm_to_serverid(api.env.realm)
dogtag_uri = 'ldapi://%%2fvar%%2frun%%2fslapd-%s.socket' % server_id
- conn = ldap2.ldap2(shared_instance=False, ldap_uri=dogtag_uri)
+ conn = ldap2.ldap2(api, ldap_uri=dogtag_uri)
if not conn.isconnected():
conn.connect(autobind=True)
diff --git a/ipaserver/install/ipa_cacert_manage.py b/ipaserver/install/ipa_cacert_manage.py
index e07460169..01ec805fc 100644
--- a/ipaserver/install/ipa_cacert_manage.py
+++ b/ipaserver/install/ipa_cacert_manage.py
@@ -121,7 +121,7 @@ class CACertManage(admintool.AdminTool):
return rc
def ldap_connect(self):
- conn = ldap2()
+ conn = ldap2(api)
password = self.options.password
if not password:
diff --git a/ipaserver/install/ipa_otptoken_import.py b/ipaserver/install/ipa_otptoken_import.py
index c6a69c997..386ca4273 100644
--- a/ipaserver/install/ipa_otptoken_import.py
+++ b/ipaserver/install/ipa_otptoken_import.py
@@ -507,7 +507,7 @@ class OTPTokenImport(admintool.AdminTool):
api.bootstrap(in_server=True)
api.finalize()
- conn = ldap2()
+ conn = ldap2(api)
try:
ccache = krbV.default_context().default_ccache()
conn.connect(ccache=ccache)
diff --git a/ipaserver/install/ipa_replica_prepare.py b/ipaserver/install/ipa_replica_prepare.py
index 3a2975bf6..c2e7a0fb5 100644
--- a/ipaserver/install/ipa_replica_prepare.py
+++ b/ipaserver/install/ipa_replica_prepare.py
@@ -637,7 +637,7 @@ class ReplicaPrepare(admintool.AdminTool):
os.remove(agent_name)
def update_pki_admin_password(self):
- ldap = ldap2(shared_instance=False)
+ ldap = ldap2(api)
ldap.connect(
bind_dn=DN(('cn', 'directory manager')),
bind_pw=self.dirman_password
diff --git a/ipaserver/install/server/install.py b/ipaserver/install/server/install.py
index 2c5183ba4..72376357b 100644
--- a/ipaserver/install/server/install.py
+++ b/ipaserver/install/server/install.py
@@ -240,8 +240,7 @@ def set_subject_in_config(realm_name, dm_password, suffix, subject_base):
installutils.realm_to_serverid(realm_name)
)
try:
- conn = ldap2(shared_instance=False, ldap_uri=ldapuri,
- base_dn=suffix)
+ conn = ldap2(api, ldap_uri=ldapuri)
conn.connect(bind_dn=DN(('cn', 'directory manager')),
bind_pw=dm_password)
except errors.ExecutionError, e: