From e0573d3099e0d941baae1d7ddf4376adf388a6c0 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Mon, 2 May 2016 08:42:50 -0400 Subject: [PATCH] make vi the default editor if no EDITOR fixes #15577 --- docs/man/man1/ansible-vault.1.asciidoc.in | 2 +- docsite/rst/playbooks_vault.rst | 2 +- lib/ansible/parsing/vault/__init__.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/man/man1/ansible-vault.1.asciidoc.in b/docs/man/man1/ansible-vault.1.asciidoc.in index 3db033b3f7..2162f980b3 100644 --- a/docs/man/man1/ansible-vault.1.asciidoc.in +++ b/docs/man/man1/ansible-vault.1.asciidoc.in @@ -63,7 +63,7 @@ CREATE The *create* sub-command is used to initialize a new encrypted file. After providing a password, the tool will launch whatever editor you have defined -with $EDITOR, and defaults to vim. Once you are done with the editor session, the +with $EDITOR, and defaults to vi. Once you are done with the editor session, the file will be saved as encrypted data. The default cipher is AES (which is shared-secret based). diff --git a/docsite/rst/playbooks_vault.rst b/docsite/rst/playbooks_vault.rst index f31d8fb9e9..bcdbcfb253 100644 --- a/docsite/rst/playbooks_vault.rst +++ b/docsite/rst/playbooks_vault.rst @@ -29,7 +29,7 @@ To create a new encrypted data file, run the following command:: First you will be prompted for a password. The password used with vault currently must be the same for all files you wish to use together at the same time. -After providing a password, the tool will launch whatever editor you have defined with $EDITOR, and defaults to vim. Once you are done with the editor session, the file will be saved as encrypted data. +After providing a password, the tool will launch whatever editor you have defined with $EDITOR, and defaults to vi (before 2.1 the default was vim). Once you are done with the editor session, the file will be saved as encrypted data. The default cipher is AES (which is shared-secret based). diff --git a/lib/ansible/parsing/vault/__init__.py b/lib/ansible/parsing/vault/__init__.py index 8635da52bf..c48902a20d 100644 --- a/lib/ansible/parsing/vault/__init__.py +++ b/lib/ansible/parsing/vault/__init__.py @@ -445,7 +445,7 @@ class VaultEditor: os.chown(dest, prev.st_uid, prev.st_gid) def _editor_shell_command(self, filename): - EDITOR = os.environ.get('EDITOR','vim') + EDITOR = os.environ.get('EDITOR','vi') editor = shlex.split(EDITOR) editor.append(filename)