Please review pull request #374: default for log output is on_failure, see #10907 opened by (codec)
Description:
See redmine at https://projects.puppetlabs.com/issues/10907
- Opened: Sat Jan 21 21:30:48 UTC 2012
- Based on: puppetlabs:master (71ef29ddcfe1317f12aaf4ba41792f2b00375929)
- Requested merge: codec:ticket/10907-logoutput-on-failure (1f91760393a70d64e87751e1258c738d827a2657)
Diff follows:
diff --git a/lib/puppet/type/exec.rb b/lib/puppet/type/exec.rb
index 8525e86..1bfcccd 100755
--- a/lib/puppet/type/exec.rb
+++ b/lib/puppet/type/exec.rb
@@ -185,6 +185,8 @@ def value=(*values)
log the output when the command reports an error. Values are
**true**, *false*, *on_failure*, and any legal log level."
+ defaultto :on_failure
+
newvalues(:true, :false, :on_failure)
end
diff --git a/test/ral/type/exec.rb b/test/ral/type/exec.rb
index 587c831..ac33c6a 100755
--- a/test/ral/type/exec.rb
+++ b/test/ral/type/exec.rb
@@ -377,10 +377,10 @@ def test_logoutput
:title => "logoutputesting",
:path => "/usr/bin:/bin",
:command => "echo logoutput is false",
- :logoutput => false
)
}
+ assert_equal(:on_failure, exec[:logoutput])
assert_apply(exec)
assert_nothing_raised {
@@ -388,6 +388,15 @@ def test_logoutput
exec[:logoutput] = true
}
+ assert_equal(:true, exec[:logoutput])
+ assert_apply(exec)
+
+ assert_nothing_raised {
+ exec[:command] = "echo logoutput is false"
+ exec[:logoutput] = false
+ }
+
+ assert_equal(:false, exec[:logoutput])
assert_apply(exec)
assert_nothing_raised {
@@ -395,6 +404,7 @@ def test_logoutput
exec[:logoutput] = "on_failure"
}
+ assert_equal(:on_failure, exec[:logoutput])
assert_apply(exec)
end
-- You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
