errorhandling #2

Closed
ac124969 wants to merge 3 commits from errorhandling into main
Showing only changes of commit 206b94299b - Show all commits

View File

@ -229,10 +229,14 @@ class Config:
""" """
if realm.account is None: if realm.account is None:
raise RuntimeError("Can't get password without acccount - should use kerberos instead") raise RuntimeError("Can't get password without acccount - should use kerberos instead")
if self.password_manager:
password = self.password_manager.get_password(realm.password_name) try:
else: if self.password_manager:
password = getpass.getpass(f"Enter password for {realm.password_name}: ") password = self.password_manager.get_password(realm.password_name)
else:
password = getpass.getpass(f"Enter password for {realm.password_name}: ")
except (KeyboardInterrupt, EOFError):
exit()
if password: if password:
return password return password