Raises exception on missing cli keys

load_key_file_data was returning False on FileNotFound but get_pk was expecting an exception
This commit is contained in:
Sergi Delgado Segura
2020-01-20 16:19:45 +01:00
parent 892e25e971
commit 4eb55eaacc
2 changed files with 3 additions and 3 deletions

View File

@@ -61,13 +61,13 @@ def load_key_file_data(file_name):
key = key_file.read() key = key_file.read()
return key return key
except FileNotFoundError: except FileNotFoundError as e:
logger.error("Client's key file not found. Please check your settings.") logger.error("Client's key file not found. Please check your settings.")
return False raise e
except IOError as e: except IOError as e:
logger.error("I/O error({}): {}".format(e.errno, e.strerror)) logger.error("I/O error({}): {}".format(e.errno, e.strerror))
return False raise e
# Makes sure that the folder APPOINTMENTS_FOLDER_NAME exists, then saves the appointment and signature in it. # Makes sure that the folder APPOINTMENTS_FOLDER_NAME exists, then saves the appointment and signature in it.