From: Andréas Leroux Date: Wed, 30 Oct 2024 14:34:35 +0000 (+0100) Subject: netcmd: More explicit warning when python-gpg is missing X-Git-Tag: tdb-1.4.13~766 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f3005f851ae62ea5beb3914b4f4dac455767681;p=thirdparty%2Fsamba.git netcmd: More explicit warning when python-gpg is missing Signed-off-by: Andréas Leroux Reviewed-by: Douglas Bagnall Reviewed-by: Jennifer Sutton Autobuild-User(master): Douglas Bagnall Autobuild-Date(master): Thu Oct 31 00:23:09 UTC 2024 on atb-devel-224 --- diff --git a/python/samba/netcmd/user/readpasswords/common.py b/python/samba/netcmd/user/readpasswords/common.py index 7944d4e1682..1bf29fe3eca 100644 --- a/python/samba/netcmd/user/readpasswords/common.py +++ b/python/samba/netcmd/user/readpasswords/common.py @@ -500,10 +500,14 @@ class GetPasswordCommand(Command): calculated["Primary:CLEARTEXT"] = cv except Exception as e: + if gpg_decrypt is None: + message = decrypt_samba_gpg_help + else: + message = str(e) self.outf.write( "WARNING: '%s': SambaGPG can't be decrypted " "into CLEARTEXT: %s\n" % ( - username or account_name, e)) + username or account_name, message)) def get_utf8(a, b, username): creds_for_charcnv = credentials.Credentials()