From a5950339f43e08516130ff0b7463dbe3fa925890 Mon Sep 17 00:00:00 2001 From: Markus Roberts Date: Fri, 18 Sep 2009 16:12:08 -0700 Subject: Fix for #2654 (error generating error message) Since required_features can (and frequently does) return a single item instead of an Array, the error message needed to be more robust. The tests were not specific enough to catch the fact that an error was being raised in the generation of the error, so a more specific test was added and the required_features accessor test was beefed up a little. Signed-off-by: Markus Roberts Signed-off-by: Markus Roberts --- lib/puppet/property.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/puppet') diff --git a/lib/puppet/property.rb b/lib/puppet/property.rb index 1ed323f16..abbc71c6b 100644 --- a/lib/puppet/property.rb +++ b/lib/puppet/property.rb @@ -1,4 +1,4 @@ - # The virtual base class for properties, which are the self-contained building +# The virtual base class for properties, which are the self-contained building # blocks for actually doing work on the system. require 'puppet' @@ -384,7 +384,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) - raise ArgumentError, "Provider must have features '%s' to set '%s' to '%s'" % [features.collect { |f| f.to_s }.join(", "), self.class.name, value] unless provider.satisfies?(features) + raise ArgumentError, "Provider must have features '%s' to set '%s' to '%s'" % [[features].flatten.join(", "), self.class.name, value] unless provider.satisfies?(features) end end -- cgit