From 06603d9294ce084531517b9a4739b532f38619a5 Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Sun, 23 Oct 2022 16:40:45 +0200 Subject: [PATCH] updated encrypt_password.py script --- scripts/encrypt_password.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/encrypt_password.py b/scripts/encrypt_password.py index 0aa69ea..558f76d 100755 --- a/scripts/encrypt_password.py +++ b/scripts/encrypt_password.py @@ -10,15 +10,19 @@ GPGHOME = "/etc/salt/gpgkeys" def parse_args(): parser = argparse.ArgumentParser(description='Encrypt password') - parser.add_argument('password', type=str, nargs=1, + parser.add_argument('password', + type=str, + nargs=1, help='password to encrypt') args = parser.parse_args() return args def encrypt(password=""): - gpg = gnupg.GPG(gnupghome=GPGHOME, secret_keyring=KEYID) - encrypted_password = gpg.encrypt(password, KEYID) + gpg = gnupg.GPG(gnupghome=GPGHOME, + secret_keyring=KEYID) + encrypted_password = gpg.encrypt(password, + KEYID) return encrypted_password