mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
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:
commit
15b14b761f
@ -32,15 +32,17 @@ def _check_pkgin():
|
|||||||
ppath = salt.utils.which('pkgin')
|
ppath = salt.utils.which('pkgin')
|
||||||
if ppath is None:
|
if ppath is None:
|
||||||
# pkgin was not found in $PATH, try to find it via LOCALBASE
|
# pkgin was not found in $PATH, try to find it via LOCALBASE
|
||||||
localbase = __salt__['cmd.run'](
|
try:
|
||||||
'pkg_info -Q LOCALBASE pkgin',
|
localbase = __salt__['cmd.run'](
|
||||||
output_loglevel='trace'
|
'pkg_info -Q LOCALBASE pkgin',
|
||||||
)
|
output_loglevel='trace'
|
||||||
if localbase is not None:
|
)
|
||||||
ppath = '{0}/bin/pkgin'.format(localbase)
|
if localbase is not None:
|
||||||
if not os.path.exists(ppath):
|
ppath = '{0}/bin/pkgin'.format(localbase)
|
||||||
return None
|
if not os.path.exists(ppath):
|
||||||
|
return None
|
||||||
|
except CommandExecutionError:
|
||||||
|
return None
|
||||||
return ppath
|
return ppath
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user