From 2777e1f052a51f0f52086cdfbea790902b0cecdc Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Tue, 23 Mar 2010 10:00:11 -0700 Subject: Fixing feature validation when passed one item When I changed how the validation errors worked I accidentally caused the feature list to need to be an array rather than supporting either. Signed-off-by: Luke Kanies --- lib/puppet/property.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'lib') diff --git a/lib/puppet/property.rb b/lib/puppet/property.rb index b96f6d120..4b58abd1f 100644 --- a/lib/puppet/property.rb +++ b/lib/puppet/property.rb @@ -333,6 +333,7 @@ class Puppet::Property < Puppet::Parameter # Make sure that we've got all of the required features for a given value. def validate_features_per_value(value) if features = self.class.value_option(self.class.value_name(value), :required_features) + features = Array(features) needed_features = features.collect { |f| f.to_s }.join(", ") raise ArgumentError, "Provider must have features '#{needed_features}' to set '#{self.class.name}' to '#{value}'" unless provider.satisfies?(features) end -- cgit