Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(FACT-3023) xen command: avoid xen-toolstack warning #2357

Merged
merged 1 commit into from Apr 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion lib/schema/facter.yaml
Expand Up @@ -1894,7 +1894,7 @@ xen:
type: map
description: Return metadata for the Xen hypervisor.
resolution: |
POSIX platforms: use `/usr/lib/xen-common/bin/xen-toolstack` to locate xen admin commands if available, otherwise fallback to `/usr/sbin/xl` or `/usr/sbin/xm`. Use the found command to execute the `list` query.
POSIX platforms: if `/usr/sbin/xl` and `/usr/sbin/xm` is installed use `/usr/lib/xen-common/bin/xen-toolstack` to choose, otherwise try `/usr/sbin/xl` then `/usr/sbin/xm` in order. Use the found command to execute the `list` query.
caveats: |
POSIX platforms: confined to Xen privileged virtual machines.
elements:
Expand Down