summaryrefslogtreecommitdiffstats
path: root/lib/puppet/node
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/node')
-rwxr-xr-xlib/puppet/node/facts.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/puppet/node/facts.rb b/lib/puppet/node/facts.rb
index 8ee90b4ac..dca435c7d 100755
--- a/lib/puppet/node/facts.rb
+++ b/lib/puppet/node/facts.rb
@@ -21,6 +21,11 @@ class Puppet::Node::Facts
attr_accessor :name, :values
+ def add_local_facts
+ values["clientversion"] = Puppet.version.to_s
+ values["environment"] ||= Puppet.settings[:environment]
+ end
+
def initialize(name, values = {})
@name = name
@values = values
@@ -28,6 +33,22 @@ class Puppet::Node::Facts
add_internal
end
+ def downcase_if_necessary
+ return unless Puppet.settings[:downcasefacts]
+
+ Puppet.warning "DEPRECATION NOTICE: Fact downcasing is deprecated; please disable (20080122)"
+ values.each do |fact, value|
+ values[fact] = value.downcase if value.is_a?(String)
+ end
+ end
+
+ # Convert all fact values into strings.
+ def stringify
+ values.each do |fact, value|
+ values[fact] = value.to_s
+ end
+ end
+
private
# Add internal data to the facts for storage.