mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
Force relative role paths to be absolute and correct errors about missing path(s). (#16088)
Addresses #10811
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user