summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-06-27 18:47:48 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-06-27 18:47:48 +0000
commit57a5a71d517bd8a6ec977f7b17691695299f7959 (patch)
tree16309395977a680f35cb0c04b7f3a879b301084a /lib
parent506269fdfddbf04acd113299496f2f2c6b79b662 (diff)
downloadpuppet-57a5a71d517bd8a6ec977f7b17691695299f7959.tar.gz
puppet-57a5a71d517bd8a6ec977f7b17691695299f7959.tar.xz
puppet-57a5a71d517bd8a6ec977f7b17691695299f7959.zip
Catching errors thrown during object evaluation and marking the objects as failed.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1321 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/transaction.rb17
-rwxr-xr-xlib/puppet/type/service/smf.rb2
2 files changed, 17 insertions, 2 deletions
diff --git a/lib/puppet/transaction.rb b/lib/puppet/transaction.rb
index 6e91f6110..2578323bc 100644
--- a/lib/puppet/transaction.rb
+++ b/lib/puppet/transaction.rb
@@ -40,7 +40,22 @@ class Transaction
end
end
- changes = child.evaluate
+ begin
+ changes = child.evaluate
+ rescue => detail
+ if Puppet[:debug]
+ puts detail.backtrace
+ end
+
+ child.err "Failed to retrieve current state: %s" % detail
+
+ # Mark that it failed
+ @failures[child] += 1
+
+ # And then return
+ return []
+ end
+
unless changes.is_a? Array
changes = [changes]
end
diff --git a/lib/puppet/type/service/smf.rb b/lib/puppet/type/service/smf.rb
index 0f72479ae..2c4c2fa95 100755
--- a/lib/puppet/type/service/smf.rb
+++ b/lib/puppet/type/service/smf.rb
@@ -53,7 +53,7 @@ Puppet.type(:service).newsvctype(:smf) do
"Cannot manage legacy services through SMF"
else
raise Puppet::Error,
- "Unmanageable state %s on service %s" %
+ "Unmanageable state '%s' on service %s" %
[value, self.name]
end
end