Merge pull request #25929 from sjorge/fix-pkgin-module

salt.module.pkgin's __virtual__() should not return None if pkg_info is not present
This commit is contained in:
Mike Place 2015-08-03 09:34:15 -06:00
commit 15b14b761f

View File

@ -32,6 +32,7 @@ def _check_pkgin():
ppath = salt.utils.which('pkgin')
if ppath is None:
# pkgin was not found in $PATH, try to find it via LOCALBASE
try:
localbase = __salt__['cmd.run'](
'pkg_info -Q LOCALBASE pkgin',
output_loglevel='trace'
@ -40,7 +41,8 @@ def _check_pkgin():
ppath = '{0}/bin/pkgin'.format(localbase)
if not os.path.exists(ppath):
return None
except CommandExecutionError:
return None
return ppath