diff options
author | Markus Roberts <Markus@reality.com> | 2009-09-18 16:12:08 -0700 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2009-09-22 09:31:19 +1000 |
commit | a5950339f43e08516130ff0b7463dbe3fa925890 (patch) | |
tree | 3c1f4b60f2310e5133311433fe10f954e72e3d01 /lib/puppet | |
parent | a951163d3d8a52fff4f0340b4ed1e827f2399147 (diff) | |
download | puppet-a5950339f43e08516130ff0b7463dbe3fa925890.tar.gz puppet-a5950339f43e08516130ff0b7463dbe3fa925890.tar.xz puppet-a5950339f43e08516130ff0b7463dbe3fa925890.zip |
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 <Markus@reality.com>
Signed-off-by: Markus Roberts <Markus@reality.com>
Diffstat (limited to 'lib/puppet')
-rw-r--r-- | lib/puppet/property.rb | 4 |
1 files changed, 2 insertions, 2 deletions
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 |