mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Replace "command -v" with "which"
The former does not work in lxc-attach, while the latter does.
This commit is contained in:
parent
916b1c4f7c
commit
08658c0177
1 changed files with 3 additions and 3 deletions
|
@ -2635,17 +2635,17 @@ def set_dns(name, dnsservers=None, searchdomains=None):
|
|||
|
||||
def _need_install(name):
|
||||
ret = 0
|
||||
has_minion = retcode(name, "command -v salt-minion")
|
||||
has_minion = retcode(name, 'which salt-minion')
|
||||
# we assume that installing is when no minion is running
|
||||
# but testing the executable presence is not enougth for custom
|
||||
# installs where the bootstrap can do much more than installing
|
||||
# the bare salt binaries.
|
||||
if has_minion:
|
||||
processes = run_stdout(name, "ps aux")
|
||||
processes = run_stdout(name, 'ps aux')
|
||||
if 'salt-minion' not in processes:
|
||||
ret = 1
|
||||
else:
|
||||
retcode(name, "salt-call --local service.stop salt-minion")
|
||||
retcode(name, 'salt-call --local service.stop salt-minion')
|
||||
else:
|
||||
ret = 1
|
||||
return ret
|
||||
|
|
Loading…
Add table
Reference in a new issue