summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG11
-rw-r--r--README2
-rwxr-xr-xbin/facter14
3 files changed, 24 insertions, 3 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 2cf22ed..0c592b3 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,4 +1,15 @@
?:
+ The 'facter' executable now has an option (-p|--puppet) for loading the
+ Puppet libraries, which gives it access to Puppet's facts.
+
+ Added autoloading to Facter with a default of not loading all facts,
+ which results in a significant speedup when only one fact is sought.
+ Facts are autoloaded in either a single file named after the fact or
+ in any file in a directory named after the fact.
+
+ Significantly refactored Facter's internals, including creating tests
+ for all internal classes.
+
A netmask fact has been added closing ticket #46. It only returns the
netmask of the primary interface (in the same behaviour as the ipaddress
and macaddress facts).
diff --git a/README b/README
index 29d3d83..4e28d9d 100644
--- a/README
+++ b/README
@@ -6,5 +6,5 @@ processors, etc.
It currently cannot collect very much information, but it is architected to be
both OS and OS version specific.
-See bin/facter or http://reductivelabs.com/project/enhost for an example of the
+See bin/facter or http://reductivelabs.com/trac/enhost for an example of the
interface.
diff --git a/bin/facter b/bin/facter
index 06d61ed..60cde6d 100755
--- a/bin/facter
+++ b/bin/facter
@@ -6,7 +6,7 @@
#
# = Usage
#
-# facter [-d|--debug] [-h|--help] [-v|--version] [-y|--yaml] [fact] [fact] [...]
+# facter [-d|--debug] [-h|--help] [-p|--puppet] [-v|--version] [-y|--yaml] [fact] [fact] [...]
#
# = Description
#
@@ -24,6 +24,9 @@
# help::
# Print this help message
#
+# puppet::
+# Load the Puppet libraries, thus allowing Facter to load Puppet-specific facts.
+#
# version::
# Print the version and exit.
#
@@ -64,7 +67,8 @@ result = GetoptLong.new(
[ "--help", "-h", GetoptLong::NO_ARGUMENT ],
[ "--debug", "-d", GetoptLong::NO_ARGUMENT ],
[ "--yaml", "-y", GetoptLong::NO_ARGUMENT ],
- [ "--config", "-c", GetoptLong::REQUIRED_ARGUMENT ]
+ [ "--config", "-c", GetoptLong::REQUIRED_ARGUMENT ],
+ [ "--puppet", "-p", GetoptLong::NO_ARGUMENT ]
)
options = {
@@ -76,6 +80,12 @@ result.each { |opt,arg|
when "--version"
puts "%s" % Facter.version
exit
+ when "--puppet"
+ begin
+ require 'puppet'
+ rescue LoadError => detail
+ $stderr.puts "Could not load Puppet: %s" % detail
+ end
when "--yaml"
options[:yaml] = true
when "--debug"