Last change
on this file since 30903 was 30903, checked in by davidb, 7 years ago |
Vagrant provisioning files for a 4-node Hadoop cluster. See README.txt for more details
|
File size:
660 bytes
|
Line | |
---|
1 | module 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
|
---|
21 | end
|
---|
Note:
See
TracBrowser
for help on using the repository browser.