summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-08-31 00:39:32 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-08-31 00:39:32 +0000
commit199f5b0db724bc54b5dd0a0d6cd8da469c801012 (patch)
treeea6828f2d6cf73b34c3f52e7b77638b63468cbda /lib/puppet
parentb6b9d0b43cc5d4adec0fdba3b148b237d7de9dc6 (diff)
downloadpuppet-199f5b0db724bc54b5dd0a0d6cd8da469c801012.tar.gz
puppet-199f5b0db724bc54b5dd0a0d6cd8da469c801012.tar.xz
puppet-199f5b0db724bc54b5dd0a0d6cd8da469c801012.zip
Fixing the state so it tries to call provider methods and only checks for errors, rather than checking with respond_to?
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1521 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/type/state.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/puppet/type/state.rb b/lib/puppet/type/state.rb
index c0330c13e..de0cfeb00 100644
--- a/lib/puppet/type/state.rb
+++ b/lib/puppet/type/state.rb
@@ -268,11 +268,11 @@ class State < Puppet::Parameter
# the blocks could return values.
event = self.instance_eval(&ary[1])
else
- if provider.respond_to?(self.class.name.to_s + "=")
+ begin
provider.send(self.class.name.to_s + "=", self.should)
- else
- self.fail "%s is not a valid value for %s" %
- [value, self.class.name]
+ rescue NoMethodError
+ self.fail "The %s provider can not handle attribute %s" %
+ [provider.class.name, self.class.name]
end
end