diff options
author | Sam Dolan <samdolan@gmail.com> | 2014-06-14 04:42:47 -0700 |
---|---|---|
committer | Sam Dolan <samdolan@gmail.com> | 2014-06-14 05:13:19 -0700 |
commit | 6714748eeb87000e6fe66a3e978c4abc2f452db1 (patch) | |
tree | 232c80385396be45e0b07aa6661f7ae56d3ea2a5 /bin | |
parent | 3fb3e7e6dce046bec9d2e8c52756f368d18702c8 (diff) | |
download | ansible-6714748eeb87000e6fe66a3e978c4abc2f452db1.tar.gz |
Throw an exception for a missing <file_name> param in ansible-vault
Without this fix you have to enter your vault password before you realize
that you forgot to pass in the filename. This commit checks that an
filename argument was at least passed on the command line.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/ansible-vault | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/bin/ansible-vault b/bin/ansible-vault index 4929e1c2a1..68cc064168 100755 --- a/bin/ansible-vault +++ b/bin/ansible-vault @@ -112,7 +112,6 @@ def _read_password(filename): return data def execute_create(args, options, parser): - if len(args) > 1: raise errors.AnsibleError("'create' does not accept more than one filename") @@ -204,6 +203,11 @@ def main(): parser = build_option_parser(action) (options, args) = parser.parse_args() + if not len(args): + raise errors.AnsibleError( + "The '%s' command requires a filename as the first argument" % action + ) + # execute the desired action try: fn = globals()["execute_%s" % action] |