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
This commit is contained in:
Rob Crittenden committed 2011-02-14 10:13:52 -05:00
1 parent 6880daefee
commit 76f2d2eac2
2 files changed
+6 -2

No files matched your search

+3 -1
View File
@@ -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
+3 -1
View File
@@ -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