Clarify get_bin_path error message (#75544) (#75564)

(cherry picked from commit 3ca50a2200)
pull/75623/head
Brian Coca 3 years ago committed by GitHub
parent 463cf9fe24
commit ad4d00e1db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- get_bin_path, clarify with quotes what the missing required executable is.

@ -39,6 +39,6 @@ def get_bin_path(arg, opt_dirs=None, required=None):
bin_path = path
break
if bin_path is None:
raise ValueError('Failed to find required executable %s in paths: %s' % (arg, os.pathsep.join(paths)))
raise ValueError('Failed to find required executable "%s" in paths: %s' % (arg, os.pathsep.join(paths)))
return bin_path

@ -35,5 +35,5 @@ def test_get_path_path_raise_valueerror(mocker):
mocker.patch('os.path.isdir', return_value=False)
mocker.patch('ansible.module_utils.common.process.is_executable', return_value=True)
with pytest.raises(ValueError, match='Failed to find required executable notacommand'):
with pytest.raises(ValueError, match='Failed to find required executable "notacommand"'):
get_bin_path('notacommand')

Loading…
Cancel
Save