mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
fix(mac_brew_pkg): Use brew path from which
Signed-off-by: Antonio Ramón Sánchez Morales <antonioramonsm@gmail.com>
This commit is contained in:
parent
9a4da7d2e3
commit
2a522420ca
1 changed files with 3 additions and 3 deletions
|
@ -31,7 +31,7 @@ def __virtual__():
|
|||
"""
|
||||
if __grains__["os"] != "MacOS":
|
||||
return False, "brew module is macos specific"
|
||||
if not salt.utils.path.which("brew"):
|
||||
if not _homebrew_bin():
|
||||
return False, "The 'brew' binary was not found"
|
||||
return __virtualname__
|
||||
|
||||
|
@ -97,7 +97,7 @@ def _homebrew_bin():
|
|||
"""
|
||||
Returns the full path to the homebrew binary in the PATH
|
||||
"""
|
||||
ret = __salt__["cmd.run"]("brew --prefix", output_loglevel="trace")
|
||||
ret = __salt__["cmd.run"](salt.utils.path.which("brew")+" --prefix", output_loglevel="trace")
|
||||
ret += "/bin/brew"
|
||||
return ret
|
||||
|
||||
|
@ -111,7 +111,7 @@ def _call_brew(*cmd, failhard=True):
|
|||
_cmd = []
|
||||
if runas:
|
||||
_cmd = ["sudo -i -n -H -u {} -- ".format(runas)]
|
||||
_cmd = _cmd + [salt.utils.path.which("brew")] + list(cmd)
|
||||
_cmd = _cmd + [_homebrew_bin()] + list(cmd)
|
||||
_cmd = " ".join(_cmd)
|
||||
|
||||
runas = None
|
||||
|
|
Loading…
Add table
Reference in a new issue