Don't crash ansible-vault create when no arguments (#68667)

* Don't crash ansible-vault create when no arguments

* Add changelog entry
pull/69213/head
Sylvia van Os 4 years ago committed by GitHub
parent 813ea48fcf
commit 3f47610d94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- ansible-vault create - Fix exception on no arguments given

@ -424,7 +424,7 @@ class VaultCLI(CLI):
def execute_create(self):
''' create and open a file in an editor that will be encrypted with the provided vault secret when closed'''
if len(context.CLIARGS['args']) > 1:
if len(context.CLIARGS['args']) != 1:
raise AnsibleOptionsError("ansible-vault create can take only one filename argument")
self.editor.create_file(context.CLIARGS['args'][0], self.encrypt_secret,

Loading…
Cancel
Save