Commit 2f517f1c by Michael DeHaan

Merge pull request #1600 from fdavis/devel

ansible-playbook verifies playbooks exist before running them
parents 753ee0b8 7256c5af
......@@ -20,6 +20,7 @@
import sys
import getpass
import os
import ansible.playbook
import ansible.constants as C
......@@ -83,6 +84,12 @@ def main(args):
extra_vars = utils.parse_kv(options.extra_vars)
only_tags = options.tags.split(",")
for playbook in args:
if not os.path.exists(playbook):
raise errors.AnsibleError("the playbook: %s could not be found" % playbook)
if not os.path.isfile(playbook):
raise errors.AnsibleError("the playbook: %s does not appear to be a file" % playbook)
# run all playbooks specified on the command line
for playbook in args:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment