Add error checking to ansible-galaxy to verify the roles_path is valid
This commit is contained in:
parent
b79c98e22c
commit
aa46fcf096
1 changed files with 8 additions and 0 deletions
|
@ -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')
|
||||
|
|
Loading…
Reference in a new issue