mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-17 22:30:59 +00:00
require git when trying to use it in ansible-galaxy cli (#49212)
* require git when trying to use it in ansible-galaxy cli Previously we weren't setting `required=True` when calling `get_bin_path` and the path would return `None`, this would cause a traceback when attempting to ' '.join() to create a string representation of the failed command for error output Fixes #49200 Signed-off-by: Adam Miller <admiller@redhat.com> * add changelog Signed-off-by: Adam Miller <admiller@redhat.com>
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
minor_changes:
|
||||
- "ansible-galaxy: properly warn when git isn't found in an installed bin path instead of traceback"
|
||||
@@ -154,7 +154,7 @@ class RoleRequirement(RoleDefinition):
|
||||
raise AnsibleError("- scm %s is not currently supported" % scm)
|
||||
|
||||
try:
|
||||
scm_path = get_bin_path(scm)
|
||||
scm_path = get_bin_path(scm, required=True)
|
||||
except (ValueError, OSError, IOError):
|
||||
raise AnsibleError("could not find/use %s, it is required to continue with installing %s" % (scm, src))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user