summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJames Turnbull <james@lovedthanlost.net>2008-11-16 10:20:22 +1100
committerJames Turnbull <james@lovedthanlost.net>2008-11-16 10:20:22 +1100
commitb8ed6670cd0d77f63b153fb5d5afff41f2c03704 (patch)
treef4de9a545a9938826bbc4e7a45fd23264cd2c549 /lib
parent6be5ac84d6ebbf84c2c1b3f546c5f86edfbcc475 (diff)
downloadpuppet-b8ed6670cd0d77f63b153fb5d5afff41f2c03704.tar.gz
puppet-b8ed6670cd0d77f63b153fb5d5afff41f2c03704.tar.xz
puppet-b8ed6670cd0d77f63b153fb5d5afff41f2c03704.zip
Fixed #1735 and #1747 - Fixes to confine system
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/provider/confine/variable.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/puppet/provider/confine/variable.rb b/lib/puppet/provider/confine/variable.rb
index c868a4e9e..9bef69412 100644
--- a/lib/puppet/provider/confine/variable.rb
+++ b/lib/puppet/provider/confine/variable.rb
@@ -24,6 +24,11 @@ class Puppet::Provider::Confine::Variable < Puppet::Provider::Confine
@facter_value
end
+ def initialize(values)
+ super
+ @values = @values.collect { |v| v.to_s.downcase }
+ end
+
def message(value)
"facter value '%s' for '%s' not in required list '%s'" % [test_value, self.name, values.join(",")]
end
@@ -35,10 +40,16 @@ class Puppet::Provider::Confine::Variable < Puppet::Provider::Confine
def reset
# Reset the cache. We want to cache it during a given
- # run, but across runs.
+ # run, but not across runs.
@facter_value = nil
end
+ def valid?
+ @values.include?(test_value.to_s.downcase)
+ ensure
+ reset
+ end
+
private
def setting?