From edb1be2d7599c12a3116a17d17d5d87e7e45b4da Mon Sep 17 00:00:00 2001 From: luke Date: Thu, 12 Jul 2007 16:39:47 +0000 Subject: Fixing the :check metaparam so it does not try to check unsupported parameters git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2684 980ebf18-57e1-0310-9a29-db15c13687c0 --- lib/puppet/metatype/metaparams.rb | 9 ++++++++- lib/puppet/type.rb | 4 +++- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/puppet/metatype/metaparams.rb b/lib/puppet/metatype/metaparams.rb index ab453ab30..9825efc61 100644 --- a/lib/puppet/metatype/metaparams.rb +++ b/lib/puppet/metatype/metaparams.rb @@ -51,7 +51,14 @@ class Puppet::Type munge do |args| # If they've specified all, collect all known properties if args == :all - args = @resource.class.properties.collect do |property| + args = @resource.class.properties.find_all do |property| + # Only get properties supported by our provider + if @resource.provider + @resource.provider.class.supports_parameter?(property) + else + true + end + end.collect do |property| property.name end end diff --git a/lib/puppet/type.rb b/lib/puppet/type.rb index a35a0b12c..b4b6e3b18 100644 --- a/lib/puppet/type.rb +++ b/lib/puppet/type.rb @@ -252,10 +252,12 @@ class Type rescue ArgumentError, Puppet::Error, TypeError raise rescue => detail - self.devfail( + error = Puppet::DevError.new( "Could not set %s on %s: %s" % [attr, self.class.name, detail] ) + error.set_backtrace(detail.backtrace) + raise error end hash.delete attr end -- cgit