Don't crash ansible-vault create when no arguments (#68667)
* Don't crash ansible-vault create when no arguments * Add changelog entry
This commit is contained in:
parent
813ea48fcf
commit
3f47610d94
2 changed files with 3 additions and 1 deletions
|
@ -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…
Reference in a new issue