Skip to content

Commit

Permalink
(maint) xen command: avoid xen-toolstack warning
Browse files Browse the repository at this point in the history
xen-toolstack is deprecated and so on Puppet runs in Debian buster you
receive this nettlesome message:

  warning: something called deprecated script /usr/lib/xen-common/bin/xen-toolstack

Prior to this change we used xen-toolstack if it is present, but that is
only necessary if more than one stack is installed. Instead check if we
have multiple tool stacks and if we do use xen-toolstack if it is
present.
  • Loading branch information
lollipopman committed Apr 17, 2021
1 parent c810cf8 commit 889f4dd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/facter/resolvers/xen.rb
Expand Up @@ -56,7 +56,12 @@ def detect_domains
end

def find_command
return XEN_TOOLSTACK if File.exist?(XEN_TOOLSTACK)
num_stacks = 0
XEN_COMMANDS.each do |command|
num_stacks += 1 if File.exist?(command)
end

return XEN_TOOLSTACK if num_stacks > 1 && File.exist?(XEN_TOOLSTACK)

XEN_COMMANDS.each { |command| return command if File.exist?(command) }
end
Expand Down

0 comments on commit 889f4dd

Please sign in to comment.