From 76f2d2eac2188fc7929bb07ab6bba7af745e8998 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Thu, 10 Feb 2011 14:46:38 -0500 Subject: Handle bad DM password in ipa-host-net-manage & ipa-copmat-manage. This was resulting in a traceback because while conn was not None it wasn't connected either. ticket 920 --- install/tools/ipa-compat-manage | 4 +++- install/tools/ipa-host-net-manage | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'install/tools') diff --git a/install/tools/ipa-compat-manage b/install/tools/ipa-compat-manage index bc88cd3a..c990f9d4 100755 --- a/install/tools/ipa-compat-manage +++ b/install/tools/ipa-compat-manage @@ -101,6 +101,8 @@ def main(): ) except errors.LDAPError, 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) if args[0] == "status": try: @@ -165,7 +167,7 @@ def main(): retval = 1 finally: - if conn: + if conn.isconnected(): conn.disconnect() return retval diff --git a/install/tools/ipa-host-net-manage b/install/tools/ipa-host-net-manage index 8a8267f1..ae8a224a 100755 --- a/install/tools/ipa-host-net-manage +++ b/install/tools/ipa-host-net-manage @@ -105,6 +105,8 @@ def main(): except errors.LDAPError, 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) if args[0] == "status": try: @@ -191,7 +193,7 @@ def main(): retval = 1 finally: - if conn: + if conn.isconnected(): conn.disconnect() return retval -- cgit