Install tools crash when password prompt is interrupted

When getpass.getpass() function is interrupted via CTRL+D, EOFError
exception is thrown. Most of the install tools are not prepared for
this event and crash with this exception. Make sure that it is
handled properly and nice error message is printed.

https://fedorahosted.org/freeipa/ticket/1916
This commit is contained in:
Martin Kosek
2011-10-06 08:22:08 +02:00
parent 7d5106de97
commit 185ca8f6fc
15 changed files with 81 additions and 34 deletions

View File

@@ -100,6 +100,8 @@ def main():
dirman_password = pw.strip()
else:
dirman_password = get_dirman_password()
if dirman_password is None:
sys.exit("\nDirectory Manager password required")
api.bootstrap(context='cli', debug=options.debug)
api.finalize()