diff options
| author | Jesse Wolfe <jes5199@gmail.com> | 2010-09-13 18:11:31 -0700 |
|---|---|---|
| committer | James Turnbull <james@lovedthanlost.net> | 2010-09-14 11:39:08 +1000 |
| commit | 14f871d6a9cad5c3eda10da005a97ed8aba9e991 (patch) | |
| tree | ef6117c091384edc270d2915f60ad87ac89bb363 /lib/puppet | |
| parent | 9bdfe694bc6c60a48b45f8dd49c20c6da31445f7 (diff) | |
| download | puppet-14f871d6a9cad5c3eda10da005a97ed8aba9e991.tar.gz puppet-14f871d6a9cad5c3eda10da005a97ed8aba9e991.tar.xz puppet-14f871d6a9cad5c3eda10da005a97ed8aba9e991.zip | |
[#4756] addendum for #4756
This fixes spec and unit tests indirectly related to the previous
patch-revert.
One failure was from trying to test the User Type's roles, when,
on many platforms, the roles feature wasn't supported by the default
Provider.
Other tests could fail on some platforms because they assumed that
unsupported attributes would be ignored with a warning, but the code was
crashing instead.
Diffstat (limited to 'lib/puppet')
| -rw-r--r-- | lib/puppet/type.rb | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/puppet/type.rb b/lib/puppet/type.rb index ccb2b492a..f9aacece8 100644 --- a/lib/puppet/type.rb +++ b/lib/puppet/type.rb @@ -410,13 +410,15 @@ class Type property = self.newattr(name) - begin - # make sure the parameter doesn't have any errors - property.value = value - rescue => detail - error = Puppet::Error.new("Parameter #{name} failed: #{detail}") - error.set_backtrace(detail.backtrace) - raise error + if property + begin + # make sure the parameter doesn't have any errors + property.value = value + rescue => detail + error = Puppet::Error.new("Parameter #{name} failed: #{detail}") + error.set_backtrace(detail.backtrace) + raise error + end end nil |
