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 2011-02-10 14:46:38 -05:00
parent 6880daefee
commit 76f2d2eac2
2 changed files with 6 additions and 2 deletions

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

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