change fix to lookup path with get_bin_path

This commit is contained in:
Kristof Keppens 2013-05-27 07:38:17 +02:00
parent e2e10c1977
commit c5b40ca2ff

View file

@ -1641,16 +1641,8 @@ def run_setup(module):
# Look for the path to the facter and ohai binary and set
# the variable to that path.
facter_path = None
ohai_path = None
for dir in os.environ['PATH'].split(':'):
facter = os.path.join(dir, 'facter')
if os.path.exists(facter):
facter_path = facter
ohai = os.path.join(dir, 'ohai')
if os.path.exists(ohai):
ohai_path = ohai
facter_path = module.get_bin_path('facter')
ohai_path = module.get_bin_path('ohai')
# if facter is installed, and we can use --json because
# ruby-json is ALSO installed, include facter data in the JSON