diff options
author | James Cammarata <jimi@sngx.net> | 2014-09-09 09:41:21 -0500 |
---|---|---|
committer | James Cammarata <jimi@sngx.net> | 2014-09-09 10:59:53 -0500 |
commit | aa46fcf09623952dc19a2a9e154ae450c45d134d (patch) | |
tree | 53875a98ed4a49de3f3201e9bdb9d519c081f4f9 /bin/ansible-galaxy | |
parent | b79c98e22c5ab91f344260d06f36268a7f7629e4 (diff) | |
download | ansible-aa46fcf09623952dc19a2a9e154ae450c45d134d.tar.gz |
Add error checking to ansible-galaxy to verify the roles_path is valid
Diffstat (limited to 'bin/ansible-galaxy')
-rwxr-xr-x | bin/ansible-galaxy | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/bin/ansible-galaxy b/bin/ansible-galaxy index 7598580d82..146361da93 100755 --- a/bin/ansible-galaxy +++ b/bin/ansible-galaxy @@ -704,6 +704,14 @@ def execute_install(args, options, parser): print "- please specify a user/role name, or a roles file, but not both" sys.exit(1) + # error checking to ensure the specified roles path exists and is a directory + if not os.path.exists(roles_path): + print "- the specified role path %s does not exist" % roles_path + sys.exit(1) + elif not os.path.isdir(roles_path): + print "- the specified role path %s is not a directory" % roles_path + sys.exit(1) + roles_done = [] if role_file: f = open(role_file, 'r') |