mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-27 18:50:21 -07:00
change fix to lookup path with get_bin_path
This commit is contained in:
parent
e2e10c1977
commit
c5b40ca2ff
1 changed files with 7 additions and 15 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue