Method: Puppet::Confine.test

Defined in:
lib/puppet/confine.rb

.test(name) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/puppet/confine.rb', line 25

def self.test(name)
  unless @tests.include?(name)
    begin
      require "puppet/confine/#{name}"
    rescue LoadError => detail
      unless detail.to_s =~ /No such file|cannot load such file/i
        Puppet.warning("Could not load confine test '#{name}': #{detail}")
      end
      # Could not find file
      unless Puppet[:always_retry_plugins]
        @tests[name] = nil
      end
    end
  end
  @tests[name]
end