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
pull/65584/head
Alexandre Chouinard 5 years ago committed by ansibot
parent a0f26b40cb
commit edc7c4ddee

@ -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…
Cancel
Save