Fixed error when user fails to enter correct password

Pappy would raise exceptions and continued project in clear-text
when the user failed to enter the correct decryption password.

Added a boolean status variable to config `crypt_success` that
gets set to true when project decrypts correctly, otherwise it
is set to false.
This commit is contained in:
Nich 2016-04-05 19:04:38 -04:00
parent 6b8861058e
commit 772e7ee507
3 changed files with 8 additions and 3 deletions

View file

@ -90,6 +90,7 @@ class Crypto(object):
# Quit pappy if user doesn't retry
# or if all retries exhuasted
if not self.confirm_password_retry() or retries <= 0:
self.config.crypt_success = False
return False
else:
self.password = None
@ -106,6 +107,7 @@ class Crypto(object):
self.delete_crypt_files()
os.chdir(self.config.crypt_dir)
self.config.crypt_success = True
return True
def confirm_password_retry(self):