summaryrefslogtreecommitdiff
path: root/lib/facter/augeasversion.rb
blob: 29f8680fb6d0a31601f9797e7d80f0cf4a9148be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
Facter.add("augeasversion") do
  setcode do

    begin
      require 'augeas'
      aug = Augeas::open('', '', Augeas::NO_LOAD & Augeas::NO_STDINC)
      aug.get('/augeas/version') || nil

    rescue LoadError # don't fail if augeas isn't installed
      nil
    end
  end
end