mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
remove output check
If output=None, then key will be outputted to stdout
This commit is contained in:
parent
64bc8f3c5e
commit
8923390121
1 changed files with 9 additions and 18 deletions
|
@ -1227,30 +1227,21 @@ def encrypt(
|
|||
result = gpg.encrypt(
|
||||
text,
|
||||
recipients,
|
||||
passphrase=gpg_passphrase,
|
||||
sign=sign,
|
||||
passphrase=gpg_passphrase,
|
||||
always_trust=always_trust,
|
||||
output=output,
|
||||
)
|
||||
elif filename:
|
||||
with salt.utils.files.flopen(filename, "rb") as _fp:
|
||||
if output:
|
||||
result = gpg.encrypt_file(
|
||||
_fp,
|
||||
recipients,
|
||||
passphrase=gpg_passphrase,
|
||||
sign=sign,
|
||||
always_trust=always_trust,
|
||||
output=output,
|
||||
)
|
||||
else:
|
||||
result = gpg.encrypt_file(
|
||||
_fp,
|
||||
recipients,
|
||||
passphrase=gpg_passphrase,
|
||||
sign=sign,
|
||||
always_trust=always_trust,
|
||||
)
|
||||
result = gpg.encrypt_file(
|
||||
_fp,
|
||||
recipients,
|
||||
sign=sign,
|
||||
passphrase=gpg_passphrase,
|
||||
always_trust=always_trust,
|
||||
output=output,
|
||||
)
|
||||
else:
|
||||
raise SaltInvocationError("filename or text must be passed.")
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue