diff options
Diffstat (limited to 'install/tools/ipa-host-net-manage')
-rwxr-xr-x | install/tools/ipa-host-net-manage | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/install/tools/ipa-host-net-manage b/install/tools/ipa-host-net-manage index ae8a224aa..5da7b9222 100755 --- a/install/tools/ipa-host-net-manage +++ b/install/tools/ipa-host-net-manage @@ -96,13 +96,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: @@ -118,7 +117,7 @@ def main(): print "Plugin Disabled" except errors.NotFound: print "Plugin Disabled" - except errors.LDAPError, lde: + except errors.ExecutionError, lde: print "An error occurred while talking to the server." print lde return 0 @@ -136,7 +135,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 @@ -184,7 +183,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 @@ -193,7 +192,7 @@ def main(): retval = 1 finally: - if conn.isconnected(): + if conn and conn.isconnected(): conn.disconnect() return retval |