Skip to content

Commit

Permalink
(PA-4569) Changes to use bundled virt-what
Browse files Browse the repository at this point in the history
  • Loading branch information
skyamgarp committed Jul 26, 2024
1 parent 465c119 commit f60b61c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/facter/resolvers/virt_what.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ def post_resolve(fact_name, _options)
end

def retrieve_from_virt_what(fact_name)
output = Facter::Core::Execution.execute('virt-what', logger: log)
command = if File.readable?('/opt/puppetlabs/puppet/bin/virt-what')
'/opt/puppetlabs/puppet/bin/virt-what'
else
'virt-what'
end
output = Facter::Core::Execution.execute(command, logger: log)

@fact_list[:vm] = determine_xen(output)
@fact_list[:vm] ||= determine_other(output)
Expand Down

0 comments on commit f60b61c

Please sign in to comment.