Force relative role paths to be absolute and correct errors about missing path(s). (#16088)

Addresses #10811
This commit is contained in:
jctanner
2016-06-03 09:46:51 -04:00
committed by Brian Coca
parent 3aae0b8a6b
commit 2bf2e0fdfd
2 changed files with 13 additions and 7 deletions

View File

@@ -123,7 +123,6 @@ class GalaxyCLI(CLI):
self.options, self.args =self.parser.parse_args()
display.verbosity = self.options.verbosity
self.galaxy = Galaxy(self.options)
return True
def run(self):
@@ -468,9 +467,9 @@ class GalaxyCLI(CLI):
for path in roles_path:
role_path = os.path.expanduser(path)
if not os.path.exists(role_path):
raise AnsibleOptionsError("- the path %s does not exist. Please specify a valid path with --roles-path" % roles_path)
raise AnsibleOptionsError("- the path %s does not exist. Please specify a valid path with --roles-path" % role_path)
elif not os.path.isdir(role_path):
raise AnsibleOptionsError("- %s exists, but it is not a directory. Please specify a valid path with --roles-path" % roles_path)
raise AnsibleOptionsError("- %s exists, but it is not a directory. Please specify a valid path with --roles-path" % role_path)
path_files = os.listdir(role_path)
for path_file in path_files:
gr = GalaxyRole(self.galaxy, path_file)