summaryrefslogtreecommitdiffstats
path: root/install/tools/ipa-compat-manage
diff options
context:
space:
mode:
authorPavel Zuna <pzuna@redhat.com>2011-02-15 14:11:27 -0500
committerRob Crittenden <rcritten@redhat.com>2011-03-03 14:04:34 -0500
commit64575a411b27dde7919406fdaf5bdec07c6645f3 (patch)
treeab0870adf6181f4457959f44fb936ec705f741d2 /install/tools/ipa-compat-manage
parenteb6b3c7afc4065f12960f09791f2a5b645abef8b (diff)
downloadfreeipa-64575a411b27dde7919406fdaf5bdec07c6645f3.tar.gz
freeipa-64575a411b27dde7919406fdaf5bdec07c6645f3.tar.xz
freeipa-64575a411b27dde7919406fdaf5bdec07c6645f3.zip
Use ldapi: instead of unsecured ldap: in ipa core tools.
The patch also corrects exception handling in some of the tools. Fix #874
Diffstat (limited to 'install/tools/ipa-compat-manage')
-rwxr-xr-xinstall/tools/ipa-compat-manage11
1 files changed, 5 insertions, 6 deletions
diff --git a/install/tools/ipa-compat-manage b/install/tools/ipa-compat-manage
index c990f9d4..723950f5 100755
--- a/install/tools/ipa-compat-manage
+++ b/install/tools/ipa-compat-manage
@@ -93,13 +93,12 @@ def main():
conn = None
try:
- ldapuri = 'ldap://%s' % installutils.get_fqdn()
try:
- conn = ldap2(shared_instance=False, ldap_uri=ldapuri, base_dn='')
+ conn = ldap2(shared_instance=False, base_dn='')
conn.connect(
bind_dn='cn=directory manager', bind_pw=dirman_password
)
- except errors.LDAPError, lde:
+ except errors.ExecutionError, lde:
sys.exit("An error occurred while connecting to the server.\n%s\n" % str(lde))
except errors.ACIError, e:
sys.exit("Authentication failed: %s" % e.info)
@@ -122,7 +121,7 @@ def main():
retval = 2
except errors.NotFound:
print "Enabling plugin"
- except errors.LDAPError, lde:
+ except errors.ExecutionError, lde:
print "An error occurred while talking to the server."
print lde
retval = 1
@@ -158,7 +157,7 @@ def main():
print "An error occurred while talking to the server."
print dbe
retval = 1
- except errors.LDAPError, lde:
+ except errors.ExecutionError, lde:
print "An error occurred while talking to the server."
print lde
retval = 1
@@ -167,7 +166,7 @@ def main():
retval = 1
finally:
- if conn.isconnected():
+ if conn and conn.isconnected():
conn.disconnect()
return retval