mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge pull request #7765 from samdolan/devel
Raise exception if "file_name" isn't passed to bin/ansible-vault
This commit is contained in:
commit
053019c439
1 changed files with 5 additions and 1 deletions
|
@ -112,7 +112,6 @@ def _read_password(filename):
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def execute_create(args, options, parser):
|
def execute_create(args, options, parser):
|
||||||
|
|
||||||
if len(args) > 1:
|
if len(args) > 1:
|
||||||
raise errors.AnsibleError("'create' does not accept more than one filename")
|
raise errors.AnsibleError("'create' does not accept more than one filename")
|
||||||
|
|
||||||
|
@ -204,6 +203,11 @@ def main():
|
||||||
parser = build_option_parser(action)
|
parser = build_option_parser(action)
|
||||||
(options, args) = parser.parse_args()
|
(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
|
# execute the desired action
|
||||||
try:
|
try:
|
||||||
fn = globals()["execute_%s" % action]
|
fn = globals()["execute_%s" % action]
|
||||||
|
|
Loading…
Reference in a new issue