From f60b61c633592d960b12f4b8a64b2dfa8dc3d973 Mon Sep 17 00:00:00 2001 From: skyamgarp <130442619+skyamgarp@users.noreply.github.com> Date: Fri, 26 Jul 2024 17:48:50 +0530 Subject: [PATCH] (PA-4569) Changes to use bundled virt-what --- lib/facter/resolvers/virt_what.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/facter/resolvers/virt_what.rb b/lib/facter/resolvers/virt_what.rb index a4953b0b51..ba8a917914 100644 --- a/lib/facter/resolvers/virt_what.rb +++ b/lib/facter/resolvers/virt_what.rb @@ -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)