summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Dibowitz <phil@ipom.com>2015-08-21 14:55:33 -0700
committerPhil Dibowitz <phil@ipom.com>2015-08-21 14:55:33 -0700
commitaa3f1647a7bc30708378319c71c97e4f1af2c5f4 (patch)
treeb02a78304001df35c69c6a71eaffe370e50a4c01
parent88752a692e8a17a44174e7f6411b58790684d141 (diff)
parentb972d25ff0df05a96b9cb909fedd9047a4066642 (diff)
downloadchef-aa3f1647a7bc30708378319c71c97e4f1af2c5f4.tar.gz
Merge pull request #3805 from jaymzh/validate
Validating is comparing to true instead of ruby truthiness
-rw-r--r--CHANGELOG.md3
-rw-r--r--lib/chef/mixin/params_validate.rb2
2 files changed, 3 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e90b2bc35d..360becccb7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -21,7 +21,8 @@
[pr#3594](https://github.com/chef/chef/pull/3594): Update service provider for OSX 10.11
* [**Nate Walck**](https://github.com/natewalck):
[pr#3704](https://github.com/chef/chef/pull/3704): Add SIP (OS X 10.11) support
-
+* [**Phil Dibowitz**](https://github.com/jaymzh):
+ [pr#3805](https://github.com/chef/chef/pull/3805): LWRP parameter validators should use truthiness
* [pr#3774](https://github.com/chef/chef/pull/3774) Add support for yum-deprecated in yum provider
* [pr#3793](https://github.com/chef/chef/pull/3793) CHEF-5372: Support specific `run_levels` for RedHat service
* [pr#2460](https://github.com/chef/chef/pull/2460) add privacy flag
diff --git a/lib/chef/mixin/params_validate.rb b/lib/chef/mixin/params_validate.rb
index 1b3a8ddcae..e3c7657b1b 100644
--- a/lib/chef/mixin/params_validate.rb
+++ b/lib/chef/mixin/params_validate.rb
@@ -315,7 +315,7 @@ class Chef
value = _pv_opts_lookup(opts, key)
if !value.nil?
callbacks.each do |message, zeproc|
- if zeproc.call(value) != true
+ unless zeproc.call(value)
raise Exceptions::ValidationFailed, "Option #{key}'s value #{value} #{message}!"
end
end