cc: rename data_dir parameter in encryptor to password_file_dir

This commit is contained in:
Mike Salvatore 2021-02-25 06:44:34 -05:00
parent 115368f83d
commit fdeec3a634
1 changed files with 4 additions and 4 deletions

View File

@ -15,9 +15,9 @@ class Encryptor:
_BLOCK_SIZE = 32
_PASSWORD_FILENAME = "mongo_key.bin"
def __init__(self, data_dir):
def __init__(self, password_file_dir):
password_file = os.path.expanduser(
os.path.join(data_dir, self._PASSWORD_FILENAME)
os.path.join(password_file_dir, self._PASSWORD_FILENAME)
)
if os.path.exists(password_file):
@ -56,10 +56,10 @@ class Encryptor:
return self._unpad(cipher.decrypt(enc_message[AES.block_size :]).decode())
def initialize_encryptor(data_dir):
def initialize_encryptor(password_file_dir):
global _encryptor
_encryptor = Encryptor(data_dir)
_encryptor = Encryptor(password_file_dir)
def get_encryptor():