Sha256: fac793811804d29c26d7d78e383b88b724d2594d184a88feb2b67cbc86ef592f

Contents?: true

Size: 555 Bytes

Versions: 16

Compression:

Stored size: 555 Bytes

Contents

# A module to gather running Xen Domains
#
module Facter::Util::Xendomains
  XEN_COMMANDS = ['/usr/sbin/xl', '/usr/sbin/xm']

  def self.xen_command
    XEN_COMMANDS.find { |cmd| Facter::Util::Resolution.which(cmd) }
  end

  def self.get_domains
    command = self.xen_command
    if command
      if domains_list = Facter::Util::Resolution.exec("#{command} list 2>/dev/null")
        domains = domains_list.split("\n").reject { |line| line =~ /^(Name|Domain-0)/ }
        domains.map { |line| line.split(/\s/)[0] }.join(',')
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
facter-2.4.1 lib/facter/util/xendomains.rb
facter-2.4.1-x86-mingw32 lib/facter/util/xendomains.rb
facter-2.4.1-x64-mingw32 lib/facter/util/xendomains.rb
facter-2.4.1-universal-darwin lib/facter/util/xendomains.rb
facter-2.4.0 lib/facter/util/xendomains.rb
facter-2.4.0-x86-mingw32 lib/facter/util/xendomains.rb
facter-2.4.0-x64-mingw32 lib/facter/util/xendomains.rb
facter-2.4.0-universal-darwin lib/facter/util/xendomains.rb
facter-2.3.0 lib/facter/util/xendomains.rb
facter-2.3.0-x86-mingw32 lib/facter/util/xendomains.rb
facter-2.3.0-x64-mingw32 lib/facter/util/xendomains.rb
facter-2.3.0-universal-darwin lib/facter/util/xendomains.rb
facter-2.2.0 lib/facter/util/xendomains.rb
facter-2.2.0-x86-mingw32 lib/facter/util/xendomains.rb
facter-2.2.0-x64-mingw32 lib/facter/util/xendomains.rb
facter-2.2.0-universal-darwin lib/facter/util/xendomains.rb