summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
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?