Use path found by salt.utils.which

I ran into this problem running `salt-ssh '*' test.ping` with a
XenServer 6.5 node as the target. Even though the `lspci` and
`dmidecode` (after I installed it) commands are found by
`salt.utils.which`, because they're not actually in the `$PATH`, they
fail to execute.
This commit is contained in:
Devin Christensen 2015-06-04 01:29:29 -06:00 committed by rallytime
parent deaee68b89
commit ff7461b3cd

View File

@ -161,7 +161,7 @@ def _linux_gpu_data():
devs = []
try:
lspci_out = __salt__['cmd.run']('lspci -vmm')
lspci_out = __salt__['cmd.run']('{0} -vmm'.format(lspci))
cur_dev = {}
error = False
@ -495,7 +495,7 @@ def _virtual(osdata):
if not cmd:
continue
cmd = '{0} {1}'.format(command, ' '.join(args))
cmd = '{0} {1}'.format(cmd, ' '.join(args))
try:
ret = __salt__['cmd.run_all'](cmd)