[FACT-830] xendomains returning empty on debian hosts Created: 2015/03/02  Updated: 2015/04/14  Resolved: 2015/04/01

Status: Closed
Project: Facter
Component/s: Community
Affects Version/s: FACT 2.4.1
Fix Version/s: FACT 2.4.3

Type: Bug Priority: Normal
Reporter: Ricardo Melo Assignee: qa
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

debian wheezy 7.8

Issue Links:
relates to FACT-867 Port xendomains fact to Facter 3 Closed
Story Points: 3
Sprint: RE 2015-04-08
QA Contact: Kurt Wall


the facter is checking for /usr/sbin/xl and /usr/sbin/xm files do define the good commando to list the domains.
In some cases it is possible to have both files and be using xm. it will retunr an error.

$ sudo /usr/sbin/xl list
ERROR: A different toolstack (xm) have been selected!

If you use /usr/lib/xen-common/bin/xen-toolstack can catch the good command.

Comment by Ricardo Melo [ 2015/03/02 ]

I fixed from my side adding these lines.

— xendomains-ori.rb 2015-03-02 21:35:09.676791117 +0000
+++ xendomains.rb 2015-03-02 21:34:25.351959335 +0000
@@ -2,6 +2,10 @@
module Facter::Util::Xendomains
XEN_COMMANDS = ['/usr/sbin/xl', '/usr/sbin/xm']
+ if File.file?('/usr/lib/xen-common/bin/xen-toolstack')
+ xen_toolstack_cmd=%x('/usr/lib/xen-common/bin/xen-toolstack').chomp
+ XEN_COMMANDS.unshift(xen_toolstack_cmd)
+ end

def self.xen_command

{ |cmd| Facter::Util::Resolution.which(cmd) }
Comment by Melissa Stone [ 2015/03/16 ]

Ricardo Melo thanks for opening this ticket. Could you open a pull request with these updates against the facter/2.x branch? That will make it easier for us to review and get the fix in.

Comment by Ricardo Melo [ 2015/03/20 ]

Melissa Stone
PR #872 submited (https://github.com/puppetlabs/facter/pull/872).

Comment by Kylo Ginsberg [ 2015/04/01 ]

This was validated during review and we don't have VMs set up for this, so resolving.

Generated at Tue Jul 14 03:41:02 PDT 2020 using Jira 8.5.2#805002-sha1:a66f9354b9e12ac788984e5d84669c903a370049.