source: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/facter/util/puppet_settings.rb@ 30960

Last change on this file since 30960 was 30960, checked in by davidb, 7 years ago

Switch to using Puppet to provision machine. Strongly based on files developed for spark-hdfs cluster

File size: 660 bytes
Line 
1module Facter
2 module Util
3 module PuppetSettings
4 # This method is intended to provide a convenient way to evaluate a
5 # Facter code block only if Puppet is loaded. This is to account for the
6 # situation where the fact happens to be in the load path, but Puppet is
7 # not loaded for whatever reason. Perhaps the user is simply running
8 # facter without the --puppet flag and they happen to be working in a lib
9 # directory of a module.
10 def self.with_puppet
11 begin
12 Module.const_get("Puppet")
13 rescue NameError
14 nil
15 else
16 yield
17 end
18 end
19 end
20 end
21end
Note: See TracBrowser for help on using the repository browser.