Fix encrypt command output when using --stdin-name (#65122)
* Fix encrypt command output when using --stdin-name Add a new line after reading input if input doesn't end with a new line * Only print is we're in a tty * Add changelog fragment
This commit is contained in:
parent
a0f26b40cb
commit
edc7c4ddee
2 changed files with 5 additions and 0 deletions
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- ansible-vault - Fix ``encrypt_string`` output in a tty when using ``--sdtin-name`` option (https://github.com/ansible/ansible/issues/65121)
|
|
@ -318,6 +318,9 @@ class VaultCLI(CLI):
|
|||
if stdin_text == '':
|
||||
raise AnsibleOptionsError('stdin was empty, not encrypting')
|
||||
|
||||
if sys.stdout.isatty() and not stdin_text.endswith("\n"):
|
||||
display.display("\n")
|
||||
|
||||
b_plaintext = to_bytes(stdin_text)
|
||||
|
||||
# defaults to None
|
||||
|
|
Loading…
Reference in a new issue